mirror of
https://github.com/Jellify-Music/App.git
synced 2026-04-22 09:58:46 -05:00
50 lines
1.4 KiB
TypeScript
50 lines
1.4 KiB
TypeScript
jest.mock('react-native-nitro-player', () => ({
|
|
TrackPlayer: {
|
|
configure: jest.fn(),
|
|
play: jest.fn(),
|
|
pause: jest.fn(),
|
|
seek: jest.fn(),
|
|
getState: jest.fn().mockResolvedValue({}),
|
|
skipToIndex: jest.fn(),
|
|
skipToNext: jest.fn(),
|
|
skipToPrevious: jest.fn(),
|
|
onChangeTrack: jest.fn(),
|
|
onPlaybackProgressChange: jest.fn(),
|
|
onPlaybackStateChange: jest.fn(),
|
|
onTracksNeedUpdate: jest.fn(),
|
|
setRepeatMode: jest.fn(),
|
|
},
|
|
PlayerQueue: {
|
|
getCurrentPlaylistId: jest.fn(),
|
|
getPlaylist: jest.fn(),
|
|
createPlaylist: jest.fn(),
|
|
addTracksToPlaylist: jest.fn(),
|
|
reorderTrackInPlaylist: jest.fn(),
|
|
},
|
|
DownloadManager: {
|
|
configure: jest.fn(),
|
|
downloadTrack: jest.fn(),
|
|
deleteTrack: jest.fn(),
|
|
getDownloadedTracks: jest.fn().mockResolvedValue([]),
|
|
isTrackDownloaded: jest.fn().mockReturnValue(false),
|
|
onDownloadComplete: jest.fn(),
|
|
},
|
|
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: [] }),
|
|
}))
|