Compare commits

...

2 Commits

Author SHA1 Message Date
Evan
985ebb796e test(databases): assert form inputs are enabled after SQLAlchemy switch
Strengthens the presence check to also confirm the form fields are
usable, per bito-code-review feedback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 18:26:41 -07:00
Claude Code
b304f33a9b 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 <noreply@anthropic.com>
2026-07-06 12:17:11 -07:00

View File

@@ -1804,8 +1804,17 @@ 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)
const nameInput = await screen.findByTestId('database-name-input');
const uriInput = screen.getByTestId('sqlalchemy-uri-input');
expect(nameInput).toBeInTheDocument();
expect(uriInput).toBeInTheDocument();
// also confirm the form is actually usable, not just present
expect(nameInput).toBeEnabled();
expect(uriInput).toBeEnabled();
});
test.each([