-
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.
* added total tag counters to album cover cards * added number of tagged photos out of total * added photo tag counter in album view * fixed lint * lint fix 2 * added unit test for feature * fixed lint for unit test * fixed lint for unit test again
- Loading branch information
Showing
6 changed files
with
72 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
let album; | ||
let photos = []; | ||
|
||
module('Unit | Model | photo-album', function (hooks) { | ||
setupTest(hooks); | ||
|
||
hooks.beforeEach(function () { | ||
const store = this.owner.lookup('service:store'); | ||
photos = [ | ||
store.createRecord('Photo'), | ||
store.createRecord('Photo'), | ||
store.createRecord('Photo'), | ||
]; | ||
album = store.createRecord('PhotoAlbum', { photos }); | ||
}); | ||
|
||
test('Photo count', function (assert) { | ||
assert.expect(2); | ||
photos[0].amountOfTags = 0; | ||
photos[1].amountOfTags = 1; | ||
photos[2].amountOfTags = 5; | ||
assert.equal(album.amountOfPhotos, 3, 'Amount of photos is correct'); | ||
assert.equal( | ||
album.amountOfTaggedPhotos, | ||
2, | ||
'Amount of tagged photos in album is correct' | ||
); | ||
}); | ||
}); |
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