-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(playertests): extend loading tests and add unloading tests
- Loading branch information
1 parent
f1dc4cf
commit 6c8b9aa
Showing
4 changed files
with
74 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import PlaybackTest from './playbackTest'; | ||
import LoadingTest from './loadingTest'; | ||
import UnloadingTest from './unloadingTest'; | ||
|
||
export default [PlaybackTest, LoadingTest]; | ||
export default [PlaybackTest, LoadingTest, UnloadingTest]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { TestScope } from 'cavy'; | ||
import { | ||
callPlayerAndExpectEvent, | ||
EventType, | ||
startPlayerTest, | ||
} from '../playertesting'; | ||
import { Sources } from './helper/Sources'; | ||
|
||
export default (spec: TestScope) => { | ||
spec.describe('unloading the player', () => { | ||
spec.it('emits SourceUnloaded event', async () => { | ||
await startPlayerTest({}, async () => { | ||
await callPlayerAndExpectEvent((player) => { | ||
player.load(Sources.artOfMotionHls); | ||
}, EventType.Ready); | ||
await callPlayerAndExpectEvent((player) => { | ||
player.unload(); | ||
}, EventType.SourceUnloaded); | ||
}); | ||
}); | ||
}); | ||
}; |