@@ -1678,19 +1678,6 @@ describe('Basic tests', function () {
1678
1678
expect ( that . requests [ 0 ] . url ) . toBe ( 'https://api.spotify.com/v1/me/player' ) ;
1679
1679
} ) ;
1680
1680
1681
- it ( 'should queue' , function ( ) {
1682
- var callback = sinon . spy ( ) ;
1683
- var api = new SpotifyWebApi ( ) ;
1684
- api . queue ( 'spotify:track:1301WleyT98MSxVHPZCA6M' , callback ) ;
1685
- that . requests [ 0 ] . respond ( 204 ) ;
1686
- expect ( that . requests [ 0 ] . method ) . toBe ( 'POST' ) ;
1687
- expect ( callback . calledWith ( null , '' ) ) . toBeTruthy ( ) ;
1688
- expect ( that . requests . length ) . toBe ( 1 ) ;
1689
- expect ( that . requests [ 0 ] . url ) . toBe (
1690
- 'https://api.spotify.com/v1/me/player/queue?uri=spotify%3Atrack%3A1301WleyT98MSxVHPZCA6M'
1691
- ) ;
1692
- } ) ;
1693
-
1694
1681
it ( 'should play' , function ( ) {
1695
1682
var callback = sinon . spy ( ) ;
1696
1683
var api = new SpotifyWebApi ( ) ;
@@ -1730,6 +1717,38 @@ describe('Basic tests', function () {
1730
1717
) ;
1731
1718
} ) ;
1732
1719
1720
+ it ( 'should queue a track' , function ( ) {
1721
+ var callback = sinon . spy ( ) ;
1722
+ var api = new SpotifyWebApi ( ) ;
1723
+ api . queue ( 'spotify:track:2Oehrcv4Kov0SuIgWyQY9e' , { } , callback ) ;
1724
+ that . requests [ 0 ] . respond ( 204 ) ;
1725
+ expect ( that . requests [ 0 ] . method ) . toBe ( 'POST' ) ;
1726
+ expect ( callback . calledWith ( null , '' ) ) . toBeTruthy ( ) ;
1727
+ expect ( that . requests . length ) . toBe ( 1 ) ;
1728
+ expect ( that . requests [ 0 ] . url ) . toBe (
1729
+ 'https://api.spotify.com/v1/me/player/queue?uri=spotify%3Atrack%3A2Oehrcv4Kov0SuIgWyQY9e'
1730
+ ) ;
1731
+ } ) ;
1732
+
1733
+ it ( 'should queue a track on a certain device' , function ( ) {
1734
+ var callback = sinon . spy ( ) ;
1735
+ var api = new SpotifyWebApi ( ) ;
1736
+ api . queue (
1737
+ 'spotify:track:2Oehrcv4Kov0SuIgWyQY9e' ,
1738
+ {
1739
+ device_id : 'my_device_id'
1740
+ } ,
1741
+ callback
1742
+ ) ;
1743
+ that . requests [ 0 ] . respond ( 204 ) ;
1744
+ expect ( that . requests [ 0 ] . method ) . toBe ( 'POST' ) ;
1745
+ expect ( callback . calledWith ( null , '' ) ) . toBeTruthy ( ) ;
1746
+ expect ( that . requests . length ) . toBe ( 1 ) ;
1747
+ expect ( that . requests [ 0 ] . url ) . toBe (
1748
+ 'https://api.spotify.com/v1/me/player/queue?uri=spotify%3Atrack%3A2Oehrcv4Kov0SuIgWyQY9e&device_id=my_device_id'
1749
+ ) ;
1750
+ } ) ;
1751
+
1733
1752
it ( 'should pause' , function ( ) {
1734
1753
var callback = sinon . spy ( ) ;
1735
1754
var api = new SpotifyWebApi ( ) ;
0 commit comments