This repository has been archived by the owner on Jun 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
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
28172e1
commit 5c4504f
Showing
2 changed files
with
31 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use es6'; | ||
|
||
import {expect} from 'chai'; | ||
import GameScores from '../src/data/models/GameScores'; | ||
import PeriodScore from '../src/data/models/PeriodScore'; | ||
import Score from '../src/data/models/Score'; | ||
|
||
describe('Game scores model', function() { | ||
it('creates game scores model', function() { | ||
const defaultGameScores = new GameScores(); | ||
|
||
expect(defaultGameScores.periodScores).to.eql([]); | ||
expect(defaultGameScores.totalScore.homeScore).to.equal(0); | ||
expect(defaultGameScores.totalScore.visitorScore).to.equal(0); | ||
}); | ||
|
||
it('get period values', function() { | ||
const periodScores = [ | ||
new PeriodScore({periodValue: 1, score: new Score({homeScore: 2, visitorScore: 3})}), | ||
new PeriodScore({periodValue: 4, score: new Score({homeScore: 5, visitorScore: 6})}), | ||
new PeriodScore({periodValue: 7, score: new Score({homeScore: 8, visitorScore: 9})}), | ||
]; | ||
const customPeriodScores = new GameScores({ | ||
periodScores: periodScores, | ||
}); | ||
|
||
expect(customPeriodScores.getPeriodValues()).to.eql([1, 4, 7]); | ||
}); | ||
}); |