Skip to content

Commit 6525675

Browse files
fix(frontend): wait for availability check before submit in test
The test was clicking submit before isAvailable was set to true, causing intermittent failures in CI. Now waits for "Ce nom est disponible" message to appear before clicking Dupliquer.
2 parents dad7019 + a4b199e commit 6525675

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/frontend/src/components/character/DuplicateModal.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,9 @@ describe('DuplicateModal', () => {
154154
await user.clear(input);
155155
await user.type(input, ' NewCharacter ');
156156

157+
// Wait for availability check to complete (not just be called)
157158
await waitFor(() => {
158-
expect(characterService.checkNameAvailability).toHaveBeenCalled();
159+
expect(screen.getByText('Ce nom est disponible')).toBeInTheDocument();
159160
});
160161

161162
await user.click(screen.getByText('Dupliquer'));

0 commit comments

Comments
 (0)