Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import ProductView from '@salesforce/retail-react-app/app/components/product-vie
import {renderWithProviders} from '@salesforce/retail-react-app/app/utils/test-utils'
import userEvent from '@testing-library/user-event'
import {useCurrentCustomer} from '@salesforce/retail-react-app/app/hooks/use-current-customer'
import frMessages from '@salesforce/retail-react-app/app/static/translations/compiled/fr-FR.json'

const MockComponent = (props) => {
const {data: customer} = useCurrentCustomer()
Expand Down Expand Up @@ -346,3 +347,25 @@ test('renders a product bundle properly - child item', () => {
expect(addToWishlistButton).toBeNull()
expect(quantityPicker).toBeNull()
})

test('renders "Add to Cart" and "Add to Wishlist" buttons in French', async () => {
const addToCart = jest.fn()
const addToWishlist = jest.fn()
renderWithProviders(
<MockComponent
product={mockProductDetail}
addToCart={addToCart}
addToWishlist={addToWishlist}
/>,
{
wrapperProps: {locale: {id: 'fr-FR'}, messages: frMessages}
}
)

const titles = await screen.findAllByText(/Black Single Pleat Athletic Fit Wool Suit/i)
expect(titles.length).toBeGreaterThan(0)
expect(screen.getByRole('button', {name: /ajouter au panier/i})).toBeInTheDocument()
expect(
screen.getByRole('button', {name: /ajouter à la liste de souhaits/i})
).toBeInTheDocument()
})
Loading