diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2022-11-26 23:44:08 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2022-11-26 23:44:08 -0400 |
commit | 003f594f6348b55109dd66416e75fcc2a88faade (patch) | |
tree | b4cb05ed4e145e604356786a1d98926040fe5ff0 /test/things.js | |
parent | 768927503b5948b846b9a6cddf4b788ca9792e8c (diff) |
finish up cosmetic style changes
Diffstat (limited to 'test/things.js')
-rw-r--r-- | test/things.js | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/test/things.js b/test/things.js index 7274515c..f36a4995 100644 --- a/test/things.js +++ b/test/things.js @@ -1,71 +1,71 @@ import test from 'tape'; import { - Album, - Thing, - Track, - TrackGroup, + Album, + Thing, + Track, + TrackGroup, } from '../src/data/things.js'; function stubAlbum(tracks) { - const album = new Album(); - const trackGroup = new TrackGroup(); - trackGroup.tracksByRef = tracks.map(t => Thing.getReference(t)); - album.trackGroups = [trackGroup]; - album.trackData = tracks; - return album; + const album = new Album(); + const trackGroup = new TrackGroup(); + trackGroup.tracksByRef = tracks.map(t => Thing.getReference(t)); + album.trackGroups = [trackGroup]; + album.trackData = tracks; + return album; } test(`Track.coverArtDate`, t => { - t.plan(5); + t.plan(5); - // Priority order is as follows, with the last (trackCoverArtDate) being - // greatest priority. - const albumDate = new Date('2010-10-10'); - const albumTrackArtDate = new Date('2012-12-12'); - const trackDateFirstReleased = new Date('2008-08-08'); - const trackCoverArtDate = new Date('2009-09-09'); + // Priority order is as follows, with the last (trackCoverArtDate) being + // greatest priority. + const albumDate = new Date('2010-10-10'); + const albumTrackArtDate = new Date('2012-12-12'); + const trackDateFirstReleased = new Date('2008-08-08'); + const trackCoverArtDate = new Date('2009-09-09'); - const track = new Track(); - track.directory = 'foo'; + const track = new Track(); + track.directory = 'foo'; - const album = stubAlbum([track]); + const album = stubAlbum([track]); - track.albumData = [album]; + track.albumData = [album]; - // 1. coverArtDate defaults to null + // 1. coverArtDate defaults to null - t.is(track.coverArtDate, null); + t.is(track.coverArtDate, null); - // 2. coverArtDate inherits album release date + // 2. coverArtDate inherits album release date - album.date = albumDate; + album.date = albumDate; - // XXX clear cache so change in album's property is reflected - track.albumData = []; - track.albumData = [album]; + // XXX clear cache so change in album's property is reflected + track.albumData = []; + track.albumData = [album]; - t.is(track.coverArtDate, albumDate); + t.is(track.coverArtDate, albumDate); - // 3. coverArtDate inherits album trackArtDate + // 3. coverArtDate inherits album trackArtDate - album.trackArtDate = albumTrackArtDate; + album.trackArtDate = albumTrackArtDate; - // XXX clear cache again - track.albumData = []; - track.albumData = [album]; + // XXX clear cache again + track.albumData = []; + track.albumData = [album]; - t.is(track.coverArtDate, albumTrackArtDate); + t.is(track.coverArtDate, albumTrackArtDate); - // 4. coverArtDate is overridden dateFirstReleased + // 4. coverArtDate is overridden dateFirstReleased - track.dateFirstReleased = trackDateFirstReleased; + track.dateFirstReleased = trackDateFirstReleased; - t.is(track.coverArtDate, trackDateFirstReleased); + t.is(track.coverArtDate, trackDateFirstReleased); - // 5. coverArtDate is overridden coverArtDate + // 5. coverArtDate is overridden coverArtDate - track.coverArtDate = trackCoverArtDate; + track.coverArtDate = trackCoverArtDate; - t.is(track.coverArtDate, trackCoverArtDate); + t.is(track.coverArtDate, trackCoverArtDate); }); |