Skip to content

Commit 25782fd

Browse files
committed
Merge branch 'caitlin-tibbetts-master'
2 parents 86ad501 + ea548e0 commit 25782fd

File tree

2 files changed

+34
-15
lines changed

2 files changed

+34
-15
lines changed

__test__/spotify-web-api.spec.js

+32-13
Original file line numberDiff line numberDiff line change
@@ -1678,19 +1678,6 @@ describe('Basic tests', function () {
16781678
expect(that.requests[0].url).toBe('https://api.spotify.com/v1/me/player');
16791679
});
16801680

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-
16941681
it('should play', function () {
16951682
var callback = sinon.spy();
16961683
var api = new SpotifyWebApi();
@@ -1730,6 +1717,38 @@ describe('Basic tests', function () {
17301717
);
17311718
});
17321719

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+
17331752
it('should pause', function () {
17341753
var callback = sinon.spy();
17351754
var api = new SpotifyWebApi();

src/spotify-web-api.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1618,8 +1618,8 @@ var SpotifyWebApi = (function () {
16181618
};
16191619

16201620
/**
1621-
* Start a new context or resume current playback on the users active device.
1622-
* See [Start/Resume a Users Playback](https://developer.spotify.com/web-api/start-a-users-playback/) on
1621+
* Play a track on the user's active device
1622+
* See [Start/Resume a User's Playback](https://developer.spotify.com/documentation/web-api/reference/player/start-a-users-playback/) on
16231623
* the Spotify Developer site for more information about the endpoint.
16241624
*
16251625
* @param {Object} options A JSON object with options that can be passed.

0 commit comments

Comments
 (0)