combine.fm/test/services/xbox.js

31 lines
1.2 KiB
JavaScript
Raw Normal View History

2015-06-03 21:45:54 -07:00
import 'should';
2015-08-20 23:22:57 +01:00
import * as xbox from '../../lib/services/xbox';
2014-12-21 01:25:04 +00:00
describe('Xbox Music', function(){
describe('lookupId', function(){
2015-06-03 21:45:54 -07:00
it('should find album by ID', function* (){
2015-08-20 23:22:57 +01:00
const result = yield xbox.lookupId('music.8b558d00-0100-11db-89ca-0019b92a3933', 'album');
2015-06-03 21:45:54 -07:00
result.name.should.equal('Muchas Gracias: The Best Of Kyuss');
2014-12-21 01:25:04 +00:00
});
2015-06-03 21:45:54 -07:00
it('should find track by ID', function* (){
2015-08-20 23:22:57 +01:00
const result = yield xbox.lookupId('music.8f558d00-0100-11db-89ca-0019b92a3933', 'track');
2015-06-03 21:45:54 -07:00
result.name.should.equal('Shine');
2014-12-21 01:25:04 +00:00
});
});
describe('search', function(){
2015-06-03 21:45:54 -07:00
it('should find album by search', function* (){
2015-08-20 23:22:57 +01:00
const result = yield xbox.search({type: 'album', artist: {name: 'Kyuss'}, name: 'Muchas Gracias: The Best Of Kyuss'});
2015-06-03 21:45:54 -07:00
result.name.should.equal('Muchas Gracias: The Best Of Kyuss');
2014-12-21 01:25:04 +00:00
});
});
describe('lookupUrl', function(){
2015-06-03 21:45:54 -07:00
it('should parse regular url into album ID', function* (){
2015-08-20 23:22:57 +01:00
const result = yield xbox.parseUrl('https://music.xbox.com/album/kyuss/muchas-gracias-the-best-of-kyuss/8b558d00-0100-11db-89ca-0019b92a3933');
2015-06-03 21:45:54 -07:00
result.id.should.equal('music.8B558D00-0100-11DB-89CA-0019B92A3933');
2014-12-21 01:25:04 +00:00
});
});
});