test: Split test utilities to improve test times (#2622)
This commit is contained in:
@@ -90,7 +90,7 @@ describe('ImageMediaPlayerController', () => {
|
||||
);
|
||||
|
||||
expect(await controller.getScreenshotURL()).toBe(url);
|
||||
expect(screenshotImage).not.toBeCalled();
|
||||
expect(screenshotImage).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -135,7 +135,7 @@ describe('ImageMediaPlayerController', () => {
|
||||
|
||||
await controller.playback?.play();
|
||||
|
||||
expect(updateControl.start).toBeCalled();
|
||||
expect(updateControl.start).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should stop the update loop on pause', async () => {
|
||||
@@ -148,7 +148,7 @@ describe('ImageMediaPlayerController', () => {
|
||||
|
||||
await controller.playback?.pause();
|
||||
|
||||
expect(updateControl.stop).toBeCalled();
|
||||
expect(updateControl.stop).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should report paused when the update loop is not running', () => {
|
||||
|
||||
@@ -23,7 +23,7 @@ describe('JSMPEGMediaPlayerController', () => {
|
||||
|
||||
await controller.playback.play();
|
||||
|
||||
expect(videoElement.play).toBeCalled();
|
||||
expect(videoElement.play).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should pause', async () => {
|
||||
@@ -37,7 +37,7 @@ describe('JSMPEGMediaPlayerController', () => {
|
||||
|
||||
await controller.playback.pause();
|
||||
|
||||
expect(videoElement.stop).toBeCalled();
|
||||
expect(videoElement.stop).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
describe('should mute', async () => {
|
||||
|
||||
@@ -80,7 +80,7 @@ describe('VideoMediaPlayerController', () => {
|
||||
|
||||
await controller.playback.play();
|
||||
|
||||
expect(video.play).toBeCalled();
|
||||
expect(video.play).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should mute if not allowed to play and unmuted', async () => {
|
||||
@@ -92,7 +92,7 @@ describe('VideoMediaPlayerController', () => {
|
||||
|
||||
await controller.playback.play();
|
||||
|
||||
expect(video.play).toBeCalledTimes(2);
|
||||
expect(video.play).toHaveBeenCalledTimes(2);
|
||||
expect(video.muted).toBeTruthy();
|
||||
});
|
||||
|
||||
@@ -105,7 +105,7 @@ describe('VideoMediaPlayerController', () => {
|
||||
|
||||
await controller.playback.play();
|
||||
|
||||
expect(video.play).toBeCalledTimes(1);
|
||||
expect(video.play).toHaveBeenCalledTimes(1);
|
||||
expect(video.muted).toBeTruthy();
|
||||
});
|
||||
|
||||
@@ -118,7 +118,7 @@ describe('VideoMediaPlayerController', () => {
|
||||
|
||||
await controller.playback.play();
|
||||
|
||||
expect(video.play).toBeCalledTimes(2);
|
||||
expect(video.play).toHaveBeenCalledTimes(2);
|
||||
expect(video.muted).toBeTruthy();
|
||||
});
|
||||
|
||||
@@ -137,7 +137,7 @@ describe('VideoMediaPlayerController', () => {
|
||||
|
||||
await controller.playback.pause();
|
||||
|
||||
expect(video.pause).toBeCalled();
|
||||
expect(video.pause).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
describe('should mute', async () => {
|
||||
@@ -211,7 +211,7 @@ describe('VideoMediaPlayerController', () => {
|
||||
|
||||
await controller.seek(10);
|
||||
|
||||
expect(hideMediaControlsTemporarily).toBeCalled();
|
||||
expect(hideMediaControlsTemporarily).toHaveBeenCalled();
|
||||
expect(video.currentTime).toBe(10);
|
||||
});
|
||||
|
||||
@@ -231,7 +231,7 @@ describe('VideoMediaPlayerController', () => {
|
||||
|
||||
await controller.setControls(true);
|
||||
|
||||
expect(setControlsOnVideo).toBeCalledWith(video, true);
|
||||
expect(setControlsOnVideo).toHaveBeenCalledWith(video, true);
|
||||
});
|
||||
|
||||
it('should set controls to default', async () => {
|
||||
@@ -244,7 +244,7 @@ describe('VideoMediaPlayerController', () => {
|
||||
|
||||
await controller.setControls();
|
||||
|
||||
expect(setControlsOnVideo).toBeCalledWith(video, true);
|
||||
expect(setControlsOnVideo).toHaveBeenCalledWith(video, true);
|
||||
});
|
||||
|
||||
it('should ignore calls without a default or value', async () => {
|
||||
@@ -252,7 +252,7 @@ describe('VideoMediaPlayerController', () => {
|
||||
|
||||
await controller.setControls(true);
|
||||
|
||||
expect(setControlsOnVideo).not.toBeCalled();
|
||||
expect(setControlsOnVideo).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user