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);
});
2015-12-22 09:53:03 +00:00
it('correctly gets artists images', () => {
artistStore.state.artists[0].image.should.equal('/public/img/covers/565c0f7067425.jpeg');
2015-12-13 04:42:28 +00:00
});
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);
});
});
2015-12-22 09:53:03 +00:00
describe('#getImage', () => {
it('correctly gets an artists image', () => {
artistStore.getImage(artistStore.state.artists[0]).should.equal('/public/img/covers/565c0f7067425.jpeg');
2015-12-13 04:42:28 +00:00
});
});
});