feat(ui): name controls and preserve modal state
This commit is contained in:
@@ -73,14 +73,14 @@ test('attachments metadata controls update purpose and ai usage', async () => {
|
||||
expect(screen.getByRole('button', { name: 'Rename: resume.pdf' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: 'Delete: resume.pdf' })).toBeInTheDocument();
|
||||
|
||||
fireEvent.mouseDown(screen.getByRole('combobox'));
|
||||
fireEvent.mouseDown(screen.getByRole('combobox', { name: /purpose/i }));
|
||||
fireEvent.click(await screen.findByRole('option', { name: /portfolio/i }));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(mockedApi.patch).toHaveBeenCalledWith('/attachments/7', expect.objectContaining({ purpose: 'portfolio', useForAi: true }));
|
||||
});
|
||||
|
||||
fireEvent.click(screen.getByRole('switch'));
|
||||
fireEvent.click(screen.getByRole('switch', { name: 'Use for AI: resume.pdf' }));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(mockedApi.patch).toHaveBeenCalledWith('/attachments/7', expect.objectContaining({ purpose: 'portfolio', useForAi: false }));
|
||||
|
||||
Reference in New Issue
Block a user