Skip to content
This repository was archived by the owner on Jul 3, 2025. It is now read-only.

test: ECOM-83 fix empty cart test #61

Merged
merged 1 commit into from
Jun 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions app/pages/cart/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CART_TABLE_STATUS } from '~/store/cart/types'
import { renderWithProviders } from '~/utils/test'
import { screen, waitFor } from '@testing-library/react'
import { screen, waitForElementToBeRemoved } from '@testing-library/react'
import Cart from '.'
import { makeStore } from '~/store'

Expand Down Expand Up @@ -41,8 +41,7 @@ describe('Empty cart', () => {
it('display empty cart message when cart is empty', async () => {
renderWithProviders(<Cart />, emptyCartState)

await waitFor(() => {
expect(screen.getByText('Your cart is empty.')).toBeInTheDocument()
})
await waitForElementToBeRemoved(() => screen.getByText('Loading...'), { timeout: 5000 })
expect(screen.getByText('Your cart is empty.')).toBeInTheDocument()
})
})