From 265112c8d74cf4f7bbfb1cf7a770b93d6d02aa4c Mon Sep 17 00:00:00 2001 From: Dave Page Date: Tue, 10 Mar 2026 12:00:22 +0000 Subject: [PATCH] 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 --- web/regression/javascript/SchemaView/SchemaDialogView.spec.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/regression/javascript/SchemaView/SchemaDialogView.spec.js b/web/regression/javascript/SchemaView/SchemaDialogView.spec.js index a6a511db819..9c4c944138e 100644 --- a/web/regression/javascript/SchemaView/SchemaDialogView.spec.js +++ b/web/regression/javascript/SchemaView/SchemaDialogView.spec.js @@ -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.');