mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-08-02 17:15:24 +02:00
feature: perfection tracker for levels with best number of commands
This commit is contained in:
parent
4cfaa0ae02
commit
928577b2dc
6 changed files with 53 additions and 16 deletions
|
@ -23,7 +23,7 @@ describe('this store', function() {
|
|||
|
||||
expect(LevelStore.isLevelSolved(firstLevel.id))
|
||||
.toEqual(false);
|
||||
LevelActions.setLevelSolved(firstLevel.id);
|
||||
LevelActions.setLevelSolved(firstLevel.id, false);
|
||||
expect(LevelStore.isLevelSolved(firstLevel.id))
|
||||
.toEqual(true);
|
||||
LevelActions.resetLevelsSolved();
|
||||
|
@ -31,4 +31,21 @@ describe('this store', function() {
|
|||
.toEqual(false);
|
||||
});
|
||||
|
||||
it('can solve a level with best status and then reset', function() {
|
||||
var sequenceMap = LevelStore.getSequenceToLevels();
|
||||
var firstLevel = sequenceMap[
|
||||
Object.keys(sequenceMap)[0]
|
||||
][0];
|
||||
|
||||
expect(LevelStore.isLevelBest(firstLevel.id))
|
||||
.toEqual(false);
|
||||
LevelActions.setLevelSolved(firstLevel.id, true);
|
||||
expect(LevelStore.isLevelBest(firstLevel.id))
|
||||
.toEqual(true);
|
||||
LevelActions.resetLevelsSolved();
|
||||
expect(LevelStore.isLevelBest(firstLevel.id))
|
||||
.toEqual(false);
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue