koel/resources/assets/js/tests/stores/artistTest.js

35 lines
1.1 KiB
JavaScript
Raw Normal View History

2015-12-13 04:42:28 +00:00
require('chai').should();
import artistStore from '../../stores/artist';
import artists from '../blobs/media';
describe('stores/artist', () => {
2015-12-14 13:13:12 +00:00
beforeEach(() => artistStore.init(artists));
2015-12-13 04:42:28 +00:00
describe('#init', () => {
it('correctly gathers artists', () => {
artistStore.state.artists.length.should.equal(3);
});
it('correctly gets artists covers', () => {
artistStore.state.artists[0].cover.should.equal('/public/img/covers/565c0f7067425.jpeg');
});
it('correctly counts songs by artists', () => {
artistStore.state.artists[0].songCount = 3;
});
});
describe('#getSongsByArtist', () => {
it('correctly gathers all songs by artist', () => {
artistStore.getSongsByArtist(artistStore.state.artists[0]).length.should.equal(3);
});
});
describe('#getCover', () => {
it('correctly gets an artists cover', () => {
artistStore.getCover(artistStore.state.artists[0]).should.equal('/public/img/covers/565c0f7067425.jpeg');
});
});
});