mirror of
https://github.com/Jellify-Music/App.git
synced 2026-04-21 00:58:32 -05:00
update nitro player mocks
This commit is contained in:
@@ -1,11 +1,45 @@
|
||||
jest.mock('react-native-nitro-player', () => ({
|
||||
TrackPlayer: jest.fn().mockImplementation(() => ({
|
||||
TrackPlayer: {
|
||||
configure: jest.fn(),
|
||||
play: jest.fn(),
|
||||
pause: jest.fn(),
|
||||
stop: jest.fn(),
|
||||
configure: jest.fn(),
|
||||
onChangeTrack: jest.fn(),
|
||||
seek: jest.fn(),
|
||||
skipToIndex: jest.fn(),
|
||||
skipToNext: jest.fn(),
|
||||
skipToPrevious: jest.fn(),
|
||||
})),
|
||||
onChangeTrack: jest.fn(),
|
||||
onPlaybackProgressChange: jest.fn(),
|
||||
onPlaybackStateChange: jest.fn(),
|
||||
setRepeatMode: jest.fn(),
|
||||
},
|
||||
PlayerQueue: {
|
||||
getCurrentPlaylist: jest.fn(),
|
||||
getPlaylist: jest.fn(),
|
||||
createPlaylist: jest.fn(),
|
||||
addTracksToPlaylist: jest.fn(),
|
||||
reorderTrackInPlaylist: jest.fn(),
|
||||
},
|
||||
DownloadManager: {
|
||||
downloadTrack: jest.fn(),
|
||||
deleteTrack: jest.fn(),
|
||||
getDownloadedTracks: jest.fn().mockResolvedValue([]),
|
||||
isTrackDownloaded: jest.fn().mockReturnValue(false),
|
||||
},
|
||||
RepeatMode: {
|
||||
None: 'none',
|
||||
One: 'one',
|
||||
All: 'all',
|
||||
},
|
||||
TrackPlayerState: {
|
||||
Playing: 'playing',
|
||||
Paused: 'paused',
|
||||
Stopped: 'stopped',
|
||||
Buffering: 'buffering',
|
||||
None: 'none',
|
||||
},
|
||||
useNowPlaying: jest.fn().mockReturnValue({ nowPlaying: undefined }),
|
||||
useOnPlaybackProgressChange: jest.fn().mockReturnValue({ position: 0, totalDuration: 0 }),
|
||||
useOnPlaybackStateChange: jest.fn().mockReturnValue({ state: 'none' }),
|
||||
useDownloadProgress: jest.fn().mockReturnValue({ progress: 0 }),
|
||||
useDownloadedTracks: jest.fn().mockReturnValue({ downloadedTracks: [] }),
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user