This repository has been archived by the owner on Oct 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Showing
12 changed files
with
119 additions
and
86 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
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 was deleted.
Oops, something went wrong.
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,60 @@ | ||
var Group = require('../src/types/group.js'); | ||
|
||
describe('Group', function () { | ||
it('can have a name', function () { | ||
var group = Group('test-name'); | ||
expect(group.name).toEqual('test-name'); | ||
}); | ||
it('is not required to have a name', function () { | ||
var group = Group(); | ||
expect(group.name).toBeUndefined(); | ||
}); | ||
describe('length()', function () { | ||
it('returns the current length', function () { | ||
var group = Group(); | ||
expect(group.length()).toEqual(0); | ||
}); | ||
}); | ||
describe('get()', function () { | ||
it('returns null on bad name', function () { | ||
var group = Group(); | ||
var slot = group.get('not-here'); | ||
expect(slot).toBeNull(); | ||
}); | ||
it('returns previously added data', function () { | ||
var group = Group(); | ||
group.add({ | ||
name: 'testname1', | ||
val: 'testval1' | ||
}); | ||
group.add({ | ||
name: 'testname2', | ||
val: 'testval2' | ||
}); | ||
expect(group.length()).toEqual(2); | ||
expect(group.get('testname1').val).toEqual('testval1'); | ||
expect(group.get('testname2').val).toEqual('testval2'); | ||
}); | ||
}); | ||
describe('getAll()', function () { | ||
it('returns all slots in the group', function () { | ||
var group = Group(); | ||
group.add({}); | ||
group.add({}); | ||
group.add({}); | ||
expect(group.getAll().length).toEqual(3); | ||
}); | ||
}); | ||
describe('clear()', function () { | ||
it('removes all existing data', function () { | ||
var group = Group(); | ||
group.add({ | ||
name: 'testname', | ||
val: 'testval' | ||
}); | ||
expect(group.length()).toEqual(1); | ||
group.clear(); | ||
expect(group.length()).toEqual(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
var harmony = require('../src/harmony.js'); | ||
|
||
describe('construction', function () { | ||
it('throws no errors', function () { | ||
it('can be loaded with require()', function () { | ||
expect(harmony).toBeDefined(); | ||
}); | ||
it('returns a useable instance', function () { | ||
// Smoke check a couple attributes. | ||
expect(harmony.load).toBeDefined(); | ||
expect(harmony.log).toBeDefined(); | ||
expect(harmony.show).toBeDefined(); | ||
expect(harmony.hide.slot).toBeDefined(); | ||
expect(harmony.show.slot).toBeDefined(); | ||
}); | ||
}); |
Oops, something went wrong.