From b47f1bd0ca894ea43ac2e130f76ddcf322bbdd9e Mon Sep 17 00:00:00 2001 From: Alex Carpenter Date: Thu, 8 Oct 2026 09:08:43 -0400 Subject: [PATCH] test(mosaic): wait for password dialog focus before typing the new password --- .changeset/mosaic-password-strength-test-focus.md | 2 ++ .../__tests__/user-profile-password-section.feature.test.tsx | 1 + 2 files changed, 3 insertions(+) create mode 100644 .changeset/mosaic-password-strength-test-focus.md diff --git a/.changeset/mosaic-password-strength-test-focus.md b/.changeset/mosaic-password-strength-test-focus.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/mosaic-password-strength-test-focus.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/packages/mosaic/src/features/user-profile/user-profile-password-section/__tests__/user-profile-password-section.feature.test.tsx b/packages/mosaic/src/features/user-profile/user-profile-password-section/__tests__/user-profile-password-section.feature.test.tsx index baf1c75d825..a0e0db7c69f 100644 --- a/packages/mosaic/src/features/user-profile/user-profile-password-section/__tests__/user-profile-password-section.feature.test.tsx +++ b/packages/mosaic/src/features/user-profile/user-profile-password-section/__tests__/user-profile-password-section.feature.test.tsx @@ -153,6 +153,7 @@ describe('Changing a password', () => { try { const user = userEvent.setup(); await user.click(screen.getByRole('button', { name: 'Change password' })); + await waitFor(() => expect(screen.getByLabelText('Current password')).toHaveFocus()); await user.type(screen.getByLabelText('New password'), 'new-password-123'); await waitFor(() =>