Skip to content

Commit

Permalink
Deflake teleport/Welcome/Welcome.test.tsx (#49874)
Browse files Browse the repository at this point in the history
  • Loading branch information
ravicious authored Dec 10, 2024
1 parent af06f54 commit 76e843b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions web/packages/teleport/src/Welcome/Welcome.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import { MemoryRouter, Route, Router } from 'react-router';
import { createMemoryHistory } from 'history';
import { fireEvent, render, screen, waitFor } from 'design/utils/testing';
Expand Down Expand Up @@ -89,7 +88,7 @@ describe('teleport/components/Welcome', () => {
expect(auth.fetchPasswordToken).toHaveBeenCalled();
});

expect(screen.getByText(/confirm password/i)).toBeInTheDocument();
expect(await screen.findByText(/confirm password/i)).toBeInTheDocument();
});

it('should have correct welcome prompt flow for reset', async () => {
Expand Down Expand Up @@ -123,7 +122,7 @@ describe('teleport/components/Welcome', () => {
});
expect(auth.fetchPasswordToken).toHaveBeenCalled();

expect(screen.getByText(/submit/i)).toBeInTheDocument();
expect(await screen.findByText(/submit/i)).toBeInTheDocument();
});

it('reset password', async () => {
Expand Down Expand Up @@ -217,7 +216,7 @@ describe('teleport/components/Welcome', () => {
});

// Trigger submit.
await user.click(screen.getByText(/submit/i));
await user.click(await screen.findByText(/submit/i));

expect(auth.resetPasswordWithWebauthn).toHaveBeenCalledWith(
expect.objectContaining({
Expand Down

0 comments on commit 76e843b

Please sign in to comment.