2018-04-08 16:31:46 +01:00
|
|
|
import 'should';
|
|
|
|
import * as amazon from '../../lib/services/amazon';
|
|
|
|
|
|
|
|
describe('Amazon', function () {
|
|
|
|
describe('lookupId', function () {
|
|
|
|
it('should find album by ID', function* () {
|
2018-04-13 01:42:16 +01:00
|
|
|
const result = yield amazon.lookupId('B00V8I134A', 'album');
|
2018-04-08 16:31:46 +01:00
|
|
|
result.name.should.equal('In Colour [Explicit]');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should find track by ID', function* (){
|
2018-04-13 01:42:16 +01:00
|
|
|
const result = yield amazon.lookupId('B00V8I1CKU', 'track');
|
2018-04-08 16:31:46 +01:00
|
|
|
result.name.should.equal('Sleep Sound');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('search', function(){
|
|
|
|
it('should find album by search', function* () {
|
|
|
|
const result = yield amazon.search({type: 'album', artist: {name: 'Jamie xx'}, name: 'In Colour'});
|
|
|
|
result.name.should.equal('In Colour [Explicit]');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should find track by search', function* (){
|
|
|
|
const result = yield amazon.search({type: 'track', artist: {name: 'Jamie xx'}, albumName: 'In Colour', name: 'Loud Places'});
|
|
|
|
result.name.should.equal('Loud Places');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should find awkward track by search', function* (){
|
|
|
|
const result = yield amazon.search({type: 'track', artist: {name: 'Jamie xx'}, albumName: 'In Colour (Remixes)', name: 'Loud Places [Tessela Remix]'});
|
|
|
|
result.name.should.equal('Loud Places [Tessela Remix]');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|