Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinxh committed May 4, 2023
1 parent f09ba06 commit ef654db
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ const mockLogin = jest.fn()
jest.mock('../commerce-api/auth', () => {
return jest.fn().mockImplementation(() => {
return {
login: mockLogin
login: mockLogin,
isTokenValid: true
}
})
})
Expand Down Expand Up @@ -141,7 +142,7 @@ test('Allows customer to sign in to their account', async () => {
await waitFor(() => {
expect(screen.getByText(/Welcome Tester/i)).toBeInTheDocument()
expect(screen.getByText(/you're now signed in/i)).toBeInTheDocument()
})
}, {timeout: 20000})
})

test('Renders error when given incorrect log in credentials', async () => {
Expand Down Expand Up @@ -235,6 +236,6 @@ test('Allows customer to create an account', async () => {
user.click(withinForm.getByText(/create account/i))

await waitFor(() => {
expect(screen.getAllByText(/welcome tester/i).length).toEqual(2)
})
expect(screen.getAllByText(/[email protected]/i).length).toEqual(1)
}, {timeout: 20000})
})

0 comments on commit ef654db

Please sign in to comment.