Skip to content

Commit 265112c

Browse files
dpageclaude
andcommitted
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>
1 parent a0e6da0 commit 265112c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

web/regression/javascript/SchemaView/SchemaDialogView.spec.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ describe('SchemaView', ()=>{
101101
});
102102

103103
it('change text', async ()=>{
104+
// Wait for autofocus timer (200ms in FormView) to complete
105+
await act(async ()=>{
106+
await new Promise(resolve => setTimeout(resolve, 500));
107+
});
104108
await user.type(ctrl.container.querySelector('[name="field2"]'), '2');
105109
/* Error should come for field1 as it is empty and noEmpty true */
106110
expect(ctrl.container.querySelector('[data-test="notifier-message"]')).toHaveTextContent('\'Field1\' cannot be empty.');

0 commit comments

Comments
 (0)