This is an automated email from the ASF dual-hosted git repository. rusackas pushed a commit to branch fix-database-modal-flaky-test in repository https://gitbox.apache.org/repos/asf/superset.git
commit b304f33a9b45b0eefdfbe6b188051206e4f3ad20 Author: Claude Code <[email protected]> AuthorDate: Mon Jul 6 12:17:11 2026 -0700 test(databases): stabilize flaky SQLAlchemy-form visibility assertion The form mounts inside DatabaseModal's animated tab pane, and rc-motion's animation state in jsdom is nondeterministic: toBeVisible intermittently times out (observed on unrelated PRs' jest shards) even though the form is rendered. Assert on document presence instead, which is what the tab-switch regression check actually needs. Co-Authored-By: Claude Fable 5 <[email protected]> --- .../src/features/databases/DatabaseModal/index.test.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx b/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx index adf8745028e..76dfda19e8e 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx @@ -1804,8 +1804,14 @@ describe('DatabaseModal', () => { userEvent.click(screen.getByTestId('sqla-connect-btn')); - expect(await screen.findByTestId('database-name-input')).toBeVisible(); - expect(screen.getByTestId('sqlalchemy-uri-input')).toBeVisible(); + // assert on presence rather than visibility: the SQLAlchemy form mounts + // inside an animated tab pane, and rc-motion's animation state in jsdom + // is nondeterministic, so toBeVisible flakes while the form is in fact + // rendered (see the animated={{ tabPane: true }} Tabs in DatabaseModal) + expect( + await screen.findByTestId('database-name-input'), + ).toBeInTheDocument(); + expect(screen.getByTestId('sqlalchemy-uri-input')).toBeInTheDocument(); }); test.each([
