diff --git a/src/apis/FollowApi.spec.ts b/src/apis/FollowApi.spec.ts index ebe1959..d155419 100644 --- a/src/apis/FollowApi.spec.ts +++ b/src/apis/FollowApi.spec.ts @@ -37,6 +37,23 @@ describe('FollowApi', () => { }); }); + describe('followArtist', () => { + it('should follow an artist', async () => { + const { httpMock, follow } = setup(); + + await follow.followArtist('foo'); + + expect(httpMock.put).toBeCalledWith('/me/following', { + params: { + type: 'artist', + }, + data: { + ids: ['foo'], + }, + }); + }); + }); + describe('followArtists', () => { it('should follow artists', async () => { const { httpMock, follow } = setup(); diff --git a/src/apis/FollowApi.ts b/src/apis/FollowApi.ts index 0793fc6..966ec97 100644 --- a/src/apis/FollowApi.ts +++ b/src/apis/FollowApi.ts @@ -35,6 +35,17 @@ export class FollowApi { ); } + /** + * Follow Artist + * + * Add the current user as a follower of an artist. + * + * @param artistId The Spotify ID of the artist. + */ + followArtist(artistId: string): Promise { + return this.followArtists([artistId]); + } + /** * Follow Artists *