-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the first section celebration modal showing logic. On Nutmeg+ it's shown only after the page reload or after going directly to the second section from the course home. Going through the course with the Next/Previous buttons has no effect (which worked on Maple). Notes: - the weekly goal has the same showing logic, but I assume that is correct behavior so no changes are added for it in this commit. - showing a celebration modal for the first section completion when going directly to the first unit of the second section seems to be a bug (reproduces on Maple too)
- Loading branch information
1 parent
630d44a
commit cd430eb
Showing
4 changed files
with
45 additions
and
8 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
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,15 @@ | ||
import { recordFirstSectionCelebration } from './utils'; | ||
|
||
jest.mock('@edx/frontend-platform/analytics'); | ||
jest.mock('./data/api'); | ||
jest.mock('@edx/frontend-platform/auth', () => ({ | ||
getAuthenticatedUser: jest.fn(() => ({ administrator: 'admin' })), | ||
})); | ||
|
||
describe('recordFirstSectionCelebration', () => { | ||
it('updates the local copy of the course data from the LMS', async () => { | ||
const dispatchMock = jest.fn(); | ||
recordFirstSectionCelebration('org', 'courseId', 'celebration', dispatchMock); | ||
expect(dispatchMock).toHaveBeenCalled(); | ||
}); | ||
}); |