mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-21 17:33:29 +01:00
Remove tracks function, replace with just getting album
This commit is contained in:
@@ -41,6 +41,8 @@ import {
|
||||
PUNK,
|
||||
aPlaylist,
|
||||
aRadioStation,
|
||||
anArtistSummary,
|
||||
anAlbumSummary,
|
||||
} from "./builders";
|
||||
import { InMemoryMusicService } from "./in_memory_music_service";
|
||||
import supersoap from "./supersoap";
|
||||
@@ -2356,10 +2358,8 @@ describe("wsdl api", () => {
|
||||
});
|
||||
|
||||
describe("asking for an album", () => {
|
||||
const album = anAlbum();
|
||||
const artist = anArtist({
|
||||
albums: [album],
|
||||
});
|
||||
const album = anAlbumSummary();
|
||||
const artist = anArtistSummary();
|
||||
|
||||
const track1 = aTrack({ artist, album, number: 1 });
|
||||
const track2 = aTrack({ artist, album, number: 2 });
|
||||
@@ -2370,7 +2370,12 @@ describe("wsdl api", () => {
|
||||
const tracks = [track1, track2, track3, track4, track5];
|
||||
|
||||
beforeEach(() => {
|
||||
musicLibrary.tracks.mockResolvedValue(tracks);
|
||||
musicLibrary.album.mockResolvedValue(anAlbum({
|
||||
...album,
|
||||
artistName: artist.name,
|
||||
artistId: artist.id,
|
||||
tracks
|
||||
}));
|
||||
});
|
||||
|
||||
describe("asking for all for an album", () => {
|
||||
@@ -2394,7 +2399,7 @@ describe("wsdl api", () => {
|
||||
total: tracks.length,
|
||||
})
|
||||
);
|
||||
expect(musicLibrary.tracks).toHaveBeenCalledWith(album.id);
|
||||
expect(musicLibrary.album).toHaveBeenCalledWith(album.id);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2421,7 +2426,7 @@ describe("wsdl api", () => {
|
||||
total: tracks.length,
|
||||
})
|
||||
);
|
||||
expect(musicLibrary.tracks).toHaveBeenCalledWith(album.id);
|
||||
expect(musicLibrary.album).toHaveBeenCalledWith(album.id);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user