/**
* Mock data for Spotify API responses
* Used in tests to simulate API calls without network access
*/
export const mockTrack = {
id: "3n3Ppam7vgaVa1iaRUc9Lp",
name: "Mr. Brightside",
uri: "spotify:track:3n3Ppam7vgaVa1iaRUc9Lp",
duration_ms: 222973,
explicit: false,
popularity: 87,
artists: [
{
id: "0C0XlULifJtAgn6ZNCW2eu",
name: "The Killers",
uri: "spotify:artist:0C0XlULifJtAgn6ZNCW2eu",
}
],
album: {
id: "4piJq7R3gjUOxnYs6lDCTg",
name: "Hot Fuss",
uri: "spotify:album:4piJq7R3gjUOxnYs6lDCTg",
images: [
{
url: "https://i.scdn.co/image/ab67616d0000b273ccdddd46119a4ff53eaf1f5d",
height: 640,
width: 640
},
{
url: "https://i.scdn.co/image/ab67616d00001e02ccdddd46119a4ff53eaf1f5d",
height: 300,
width: 300
},
{
url: "https://i.scdn.co/image/ab67616d00004851ccdddd46119a4ff53eaf1f5d",
height: 64,
width: 64
}
]
}
};
export const mockDevice = {
id: "5fbb3ba6aa454b5534c4ba43a8c7e8e45a63ad0e",
is_active: true,
is_private_session: false,
is_restricted: false,
name: "My MacBook Pro",
type: "Computer",
volume_percent: 75,
supports_volume: true
};
export const mockPlaybackState = {
device: mockDevice,
shuffle_state: false,
repeat_state: "off",
timestamp: 1699564800000,
progress_ms: 89523,
is_playing: true,
item: mockTrack,
currently_playing_type: "track",
actions: {
disallows: {}
},
context: {
type: "album",
href: "https://api.spotify.com/v1/albums/4piJq7R3gjUOxnYs6lDCTg",
external_urls: {
spotify: "https://open.spotify.com/album/4piJq7R3gjUOxnYs6lDCTg"
},
uri: "spotify:album:4piJq7R3gjUOxnYs6lDCTg"
}
};
export const mockCurrentlyPlaying = {
item: mockTrack,
is_playing: true,
progress_ms: 89523,
timestamp: 1699564800000,
currently_playing_type: "track",
actions: {
disallows: {}
},
context: {
type: "album",
uri: "spotify:album:4piJq7R3gjUOxnYs6lDCTg"
}
};
export const mockQueue = {
currently_playing: mockTrack,
queue: [
{
id: "7qiZfU4dY1lWllzX7mPBI",
name: "Shape of You",
artists: [{ name: "Ed Sheeran" }],
duration_ms: 233713,
uri: "spotify:track:7qiZfU4dY1lWllzX7mPBI"
},
{
id: "3cfOd4CMv2snFaKAnMdnvK",
name: "Blinding Lights",
artists: [{ name: "The Weeknd" }],
duration_ms: 200040,
uri: "spotify:track:3cfOd4CMv2snFaKAnMdnvK"
}
]
};
export const mockDevices = {
devices: [
mockDevice,
{
id: "ab4c123d5e6f7g8h9i0j1k2l3m4n5o6p",
is_active: false,
is_private_session: false,
is_restricted: false,
name: "iPhone 14",
type: "Smartphone",
volume_percent: 50,
supports_volume: true
},
{
id: "xyz789abc123def456ghi789jkl012mno",
is_active: false,
is_private_session: false,
is_restricted: false,
name: "Living Room Speaker",
type: "Speaker",
volume_percent: 65,
supports_volume: true
}
]
};
export const mockSearchResults = {
tracks: {
items: [
mockTrack,
{
id: "7qiZfU4dY1lWllzX7mPBI",
name: "Shape of You",
artists: [{ name: "Ed Sheeran" }],
album: { name: "÷ (Divide)", images: [{ url: "https://i.scdn.co/image/test.jpg" }] },
duration_ms: 233713,
explicit: false,
popularity: 89,
uri: "spotify:track:7qiZfU4dY1lWllzX7mPBI"
}
]
}
};
export const mockTokenData = {
access_token: "BQDt5Z8uMjM4NzY1NjM0NTY3ODk0NTY3ODk0NTY3ODk0NTY3ODk0",
token_type: "Bearer",
expires_in: 3600,
refresh_token: "AQDt5Z8uMjM4NzY1NjM0NTY3ODk0NTY3ODk0NTY3ODk0NTY3ODk0",
scope: "user-read-playback-state user-modify-playback-state"
};
export const mockRecentlyPlayed = {
items: [
{
track: mockTrack,
played_at: "2024-01-15T10:30:00.000Z",
context: {
type: "album",
uri: "spotify:album:4piJq7R3gjUOxnYs6lDCTg"
}
}
]
};
export const mockSavedTracks = {
items: [
{
added_at: "2024-01-10T12:00:00.000Z",
track: mockTrack
}
],
total: 1,
limit: 20,
offset: 0
};
export const mockPlaylists = {
items: [
{
id: "37i9dQZF1DXcBWIGoYBM5M",
name: "Today's Top Hits",
description: "The biggest songs right now",
owner: { display_name: "Spotify" },
public: true,
tracks: { total: 50 },
uri: "spotify:playlist:37i9dQZF1DXcBWIGoYBM5M"
}
],
total: 1,
limit: 20,
offset: 0
};
export const mockArtist = {
id: "0C0XlULifJtAgn6ZNCW2eu",
name: "The Killers",
genres: ["alternative rock", "indie rock", "rock"],
popularity: 82,
followers: { total: 8234567 },
images: [
{ url: "https://i.scdn.co/image/artist.jpg", height: 640, width: 640 }
],
uri: "spotify:artist:0C0XlULifJtAgn6ZNCW2eu"
};
export const mockAlbum = {
id: "4piJq7R3gjUOxnYs6lDCTg",
name: "Hot Fuss",
artists: [{ id: "0C0XlULifJtAgn6ZNCW2eu", name: "The Killers" }],
release_date: "2004-06-07",
total_tracks: 11,
images: [
{ url: "https://i.scdn.co/image/album.jpg", height: 640, width: 640 }
],
uri: "spotify:album:4piJq7R3gjUOxnYs6lDCTg"
};