-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from bemusic/test-notes-display
Test the newly implemented NoteArea
- Loading branch information
Showing
5 changed files
with
89 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
import NoteArea from 'bemuse/game/note-area' | ||
|
||
describe('NoteArea', function() { | ||
|
||
it('allows querying the visible note from a list of notes', function() { | ||
let notes = [ | ||
{ position: 1, column: 'A' }, | ||
{ position: 2, column: 'A' }, | ||
{ position: 3, column: 'A' }, | ||
{ position: 4, column: 'A' }, | ||
{ position: 5, column: 'A' }, | ||
{ position: 6, column: 'A' }, | ||
{ position: 10, end: { position: 12 }, column: 'B' }, | ||
{ position: 11, column: 'C' }, | ||
] | ||
let area = new NoteArea(notes) | ||
expect(area.getVisibleNotes(1.5, 3.5)).to.have.length(2) | ||
expect(area.getVisibleNotes(-1, 7)).to.have.length(6) | ||
expect(area.getVisibleNotes(8, 10.1)).to.have.length(1) | ||
expect(area.getVisibleNotes(8, 10.1)).to.have.length(1) | ||
expect(area.getVisibleNotes(8, 14)).to.have.length(2) | ||
expect(area.getVisibleNotes(11.5, 14)).to.have.length(1) | ||
expect(area.getVisibleNotes(12.5, 14)).to.have.length(0) | ||
}) | ||
|
||
}) | ||
|
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