mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-08-17 16:34:44 -05:00
Fix flakey SchemaDialogView 'change text' JS test
Add a wait for the FormView autofocus timer (200ms) to complete before typing, preventing a race condition where the autofocus moves focus away from the target field on slow CI machines. This matches the pattern already used by simulateValidData in the same test file. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
8f74b2e6d4
commit
7e39fc8477
@@ -101,6 +101,10 @@ describe('SchemaView', ()=>{
|
||||
});
|
||||
|
||||
it('change text', async ()=>{
|
||||
// Wait for autofocus timer (200ms in FormView) to complete
|
||||
await act(async ()=>{
|
||||
await new Promise(resolve => setTimeout(resolve, 500));
|
||||
});
|
||||
await user.type(ctrl.container.querySelector('[name="field2"]'), '2');
|
||||
/* Error should come for field1 as it is empty and noEmpty true */
|
||||
expect(ctrl.container.querySelector('[data-test="notifier-message"]')).toHaveTextContent('\'Field1\' cannot be empty.');
|
||||
|
||||
Reference in New Issue
Block a user