-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: [P4PU-565] back from notice detail, retry on error and paymentNo…
…tice SessionStorage clearing (#165)
- Loading branch information
Showing
6 changed files
with
61 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import { render, screen, fireEvent } from '@testing-library/react'; | ||
import { PaymentNotice } from './PaymentNotice'; | ||
|
||
describe('Payment notices error component', () => { | ||
const onRetry = vi.fn(); | ||
|
||
it('should render as expected', () => { | ||
render(<PaymentNotice.Error onRetry={onRetry} />); | ||
const button = screen.getByRole('button', { name: 'app.paymentNotice.error.button' }); | ||
expect(button).toBeVisible(); | ||
const description = screen.getByText('app.paymentNotice.error.description'); | ||
expect(description).toBeVisible(); | ||
}); | ||
|
||
it('should trigger the retry function correctly', () => { | ||
const onRetry = vi.fn(); | ||
render(<PaymentNotice.Error onRetry={onRetry} />); | ||
const button = screen.getByRole('button', { name: 'app.paymentNotice.error.button' }); | ||
fireEvent.click(button); | ||
expect(onRetry).toHaveBeenCalledOnce(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { i18nTestSetup } from './src/__tests__/i18nTestSetup'; | ||
import '@testing-library/jest-dom'; | ||
|
||
i18nTestSetup({}); |