We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9871944 commit 56cb578Copy full SHA for 56cb578
src/courseware/course/sequence/sequence-navigation/UnitButton.test.jsx
@@ -83,6 +83,15 @@ describe('Unit Button', () => {
83
expect(onClick).toHaveBeenCalledTimes(1);
84
});
85
86
+ it('calls onClick with correct unitId when clicked', () => {
87
+ const onClick = jest.fn();
88
+ render(<UnitButton {...mockData} onClick={onClick} />, { wrapWithRouter: true });
89
+
90
+ fireEvent.click(screen.getByRole('tab'));
91
92
+ expect(onClick).toHaveBeenCalledWith(mockData.unitId);
93
+ });
94
95
it('renders with no unitId and does not crash', async () => {
96
render(<UnitButton unitId={undefined} onClick={jest.fn()} contentType="video" title="Unit" />, {
97
wrapWithRouter: true,
0 commit comments