mirror of
https://github.com/Jellify-Music/App.git
synced 2026-03-20 04:01:18 -05:00
Fixing an issue where images for "Most Played" wouldn't be fetched properly Make the queue screen scroll to the currently playing track when it opens
33 lines
841 B
TypeScript
33 lines
841 B
TypeScript
import isPlaybackFinished from '../../../src/api/mutations/playback/utils'
|
|
import { Progress } from 'react-native-track-player'
|
|
|
|
describe('Playback Event Handlers', () => {
|
|
it('should determine that the track has finished', () => {
|
|
const progress: Progress = {
|
|
position: 95.23423453,
|
|
duration: 98.23557854,
|
|
buffered: 98.2345568679345,
|
|
}
|
|
|
|
const { position, duration } = progress
|
|
|
|
const playbackFinished = isPlaybackFinished(position, duration)
|
|
|
|
expect(playbackFinished).toBeTruthy()
|
|
})
|
|
|
|
it('should determine the track is still playing', () => {
|
|
const progress: Progress = {
|
|
position: 45.23423453,
|
|
duration: 98.23557854,
|
|
buffered: 98.2345568679345,
|
|
}
|
|
|
|
const { position, duration } = progress
|
|
|
|
const playbackFinished = isPlaybackFinished(position, duration)
|
|
|
|
expect(playbackFinished).toBeFalsy()
|
|
})
|
|
})
|