forked from openedx/frontend-app-learner-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFinishedPane.test.jsx
More file actions
32 lines (29 loc) · 1.14 KB
/
Copy pathFinishedPane.test.jsx
File metadata and controls
32 lines (29 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { render, screen } from '@testing-library/react';
import { formatMessage } from 'testUtils';
import { IntlProvider } from '@edx/frontend-platform/i18n';
import { FinishedPane } from './FinishedPane';
import messages from './messages';
const props = {
cardId: 'cardId',
handleClose: jest.fn().mockName('props.handleClose'),
};
describe('UnenrollConfirmModal FinishedPane', () => {
describe('gave reason', () => {
beforeEach(() => {
jest.clearAllMocks();
render(<IntlProvider locale="en"><FinishedPane {...props} /></IntlProvider>);
});
it('renders heading', () => {
const heading = screen.getByText(formatMessage(messages.finishHeading));
expect(heading).toBeInTheDocument();
});
it('renders return button', () => {
const returnButton = screen.getByRole('button', { name: formatMessage(messages.finishReturn) });
expect(returnButton).toBeInTheDocument();
});
it('Gave reason, display thanks message', () => {
const finishSuccessMessage = screen.getByText((text) => text.includes('Unenrollment Successful'));
expect(finishSuccessMessage).toBeInTheDocument();
});
});
});