diff --git a/src/apis/FollowApi.spec.ts b/src/apis/FollowApi.spec.ts index 10c0d70..fabd14e 100644 --- a/src/apis/FollowApi.spec.ts +++ b/src/apis/FollowApi.spec.ts @@ -262,6 +262,23 @@ describe('FollowApi', () => { }); }); + describe('unfollowArtist', () => { + it('should unfollow an artist', async () => { + const { httpMock, follow } = setup(); + + await follow.unfollowArtist('foo'); + + expect(httpMock.delete).toBeCalledWith('/me/following', { + params: { + type: 'artist', + }, + data: { + ids: ['foo'], + }, + }); + }); + }); + describe('unfollowArtists', () => { it('should unfollow artists', async () => { const { httpMock, follow } = setup(); diff --git a/src/apis/FollowApi.ts b/src/apis/FollowApi.ts index cc9080c..181d1fb 100644 --- a/src/apis/FollowApi.ts +++ b/src/apis/FollowApi.ts @@ -205,6 +205,17 @@ export class FollowApi { }); } + /** + * Unfollow Artist + * + * Remove the current user as a follower of an artist. + * + * @param artistId The Spotify ID of the artist. + */ + unfollowArtist(artistId: string): Promise { + return this.unfollowArtists([artistId]); + } + /** * Unfollow Artists *