Skip to content

Commit

Permalink
chore: Updated message history hook test
Browse files Browse the repository at this point in the history
  • Loading branch information
rijuma committed Nov 12, 2024
1 parent cf367ac commit b5a41cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/hooks/message-history.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ jest.mock('react-redux', () => ({
useDispatch: () => mockDispatch,
}));

jest.mock('../data/thunks');
const getLearningAssistantMessageHistorySignature = { getLearningAssistantMessageHistory: 'getLearningAssistantMessageHistory' };
jest.mock('../data/thunks', () => ({
getLearningAssistantMessageHistory: jest.fn().mockReturnValue(getLearningAssistantMessageHistorySignature),
}));

describe('Learning Assistant Message History Hooks', () => {
afterEach(() => {
Expand All @@ -33,6 +36,7 @@ describe('Learning Assistant Message History Hooks', () => {
renderTestHook(fakeCourseId, true);

expect(mockDispatch).toHaveBeenCalledTimes(1);
expect(mockDispatch).toHaveBeenCalledWith(getLearningAssistantMessageHistorySignature);
expect(getLearningAssistantMessageHistory).toHaveBeenCalledWith(fakeCourseId);
});

Expand Down

0 comments on commit b5a41cf

Please sign in to comment.