fix(tests): resolve issues with webdav scan failure testing

This commit is contained in:
perf3ct 2025-08-18 15:47:58 +00:00
parent d793509af9
commit 7616691939
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232
3 changed files with 7 additions and 5 deletions

View File

@ -436,9 +436,11 @@ describe('LabelCreateDialog Component', () => {
const createButton = screen.getByText('Create');
await user.click(createButton);
// Try to close during loading - should be disabled due to pointer-events: none
// Wait for loading state to be set and check Cancel button is disabled
await waitFor(() => {
const cancelButton = screen.getByText('Cancel');
expect(cancelButton).toBeDisabled();
});
expect(onClose).not.toHaveBeenCalled();

View File

@ -241,7 +241,7 @@ describe('FailureDetailsPanel', () => {
const notesInput = screen.getByLabelText('Notes (optional)');
await userEvent.type(notesInput, 'Path too long to fix easily');
const permanentSwitch = screen.getByRole('checkbox');
const permanentSwitch = screen.getByLabelText('Permanently exclude (recommended)');
await userEvent.click(permanentSwitch); // Toggle off
await userEvent.click(permanentSwitch); // Toggle back on

View File

@ -236,7 +236,7 @@ describe('FailureDetailsPanel', () => {
const notesInput = screen.getByLabelText('Notes (optional)');
await userEvent.type(notesInput, 'Path too long to fix easily');
const permanentSwitch = screen.getByRole('checkbox');
const permanentSwitch = screen.getByLabelText('Permanently exclude (recommended)');
await userEvent.click(permanentSwitch); // Toggle off
await userEvent.click(permanentSwitch); // Toggle back on