-
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.
- Loading branch information
1 parent
c166b2d
commit 2dbc389
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
...ponents/CoreTest/Presentation/React/LearningSpaceDisplay/SideBar/SideBarPresenter.test.ts
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,42 @@ | ||
import LearningSpaceTO from "../../../../../Core/Application/DataTransferObjects/LearningSpaceTO"; | ||
import LearningWorldTO from "../../../../../Core/Application/DataTransferObjects/LearningWorldTO"; | ||
import SideBarPresenter from "../../../../../Core/Presentation/React/LearningSpaceDisplay/SideBar/SideBarPresenter"; | ||
import SideBarViewModel from "../../../../../Core/Presentation/React/LearningSpaceDisplay/SideBar/SideBarViewModel"; | ||
|
||
describe("SideBarPresenter", () => { | ||
let systemUnderTest: SideBarPresenter; | ||
|
||
let vm = new SideBarViewModel(); | ||
beforeEach(() => { | ||
vm = new SideBarViewModel(); | ||
systemUnderTest = new SideBarPresenter(vm); | ||
}); | ||
test("onLearningWorldLoaded sets allowWorldCompletionModalButtonClick", () => { | ||
const worldTO = { | ||
completionModalShown: false, | ||
spaces: [ | ||
{ | ||
id: 1, | ||
currentScore: 1, | ||
requiredScore: 1, | ||
} as LearningSpaceTO, | ||
{ | ||
id: 2, | ||
currentScore: 1, | ||
requiredScore: 1, | ||
} as LearningSpaceTO, | ||
], | ||
} as LearningWorldTO; | ||
systemUnderTest.onLearningWorldLoaded(worldTO); | ||
expect(vm.allowWorldCompletionModalButtonClick).toBe(true); | ||
}); | ||
test("OnLearningWorldScored sets allowWorldCompletionModalButtonClick", () => { | ||
const worldScoreTo = { | ||
worldID: 1, | ||
currentScore: 1, | ||
requiredScore: 1, | ||
}; | ||
systemUnderTest.onLearningWorldScored(worldScoreTo); | ||
expect(vm.allowWorldCompletionModalButtonClick).toBe(true); | ||
}); | ||
}); |