diff --git a/tests/plugins/plugin-video-button-response.test.js b/tests/plugins/plugin-video-button-response.test.js index 84780355..eaeeda58 100644 --- a/tests/plugins/plugin-video-button-response.test.js +++ b/tests/plugins/plugin-video-button-response.test.js @@ -14,22 +14,19 @@ describe('video-button-response plugin', function(){ expect(typeof window.jsPsych.plugins['video-button-response']).not.toBe('undefined'); }); - test('video preloading initiates automatically', function(){ + test('video preloading registers correctly', function(){ const preload_spy = jest.spyOn(jsPsych.pluginAPI, 'registerPreload'); - const console_spy = jest.spyOn(console, 'warn'); require(root + 'plugins/jspsych-video-button-response.js'); var trial = { type: 'video-button-response', - stimulus: [root + 'tests/media/sample_video.mp4'], + stimulus: ['vid.mp4'], choices: ['y'] } jsPsych.init({ timeline: [trial] }); expect(preload_spy).toHaveBeenCalled(); - expect(console_spy).not.toHaveBeenCalledWith('jsPsych failed to auto preload one or more files:'); preload_spy.mockRestore(); - console_spy.mockRestore(); }); }); diff --git a/tests/plugins/plugin-video-keyboard-response.test.js b/tests/plugins/plugin-video-keyboard-response.test.js index c63db206..6f389aca 100644 --- a/tests/plugins/plugin-video-keyboard-response.test.js +++ b/tests/plugins/plugin-video-keyboard-response.test.js @@ -14,22 +14,19 @@ describe('video-keyboard-response plugin', function(){ expect(typeof window.jsPsych.plugins['video-keyboard-response']).not.toBe('undefined'); }); - test('video preloading initiates automatically', function(){ + test('video preloading registers correctly', function(){ const preload_spy = jest.spyOn(jsPsych.pluginAPI, 'registerPreload'); - const console_spy = jest.spyOn(console, 'warn'); require(root + 'plugins/jspsych-video-keyboard-response.js'); var trial = { type: 'video-keyboard-response', - stimulus: [root + 'tests/media/sample_video.mp4'], + stimulus: ['video.mp4'], choices: jsPsych.ALL_KEYS } jsPsych.init({ timeline: [trial] }); expect(preload_spy).toHaveBeenCalled(); - expect(console_spy).not.toHaveBeenCalledWith('jsPsych failed to auto preload one or more files:'); preload_spy.mockRestore(); - console_spy.mockRestore(); }); }); diff --git a/tests/plugins/plugin-video-slider-response.test.js b/tests/plugins/plugin-video-slider-response.test.js index a95efa6f..2dec34e4 100644 --- a/tests/plugins/plugin-video-slider-response.test.js +++ b/tests/plugins/plugin-video-slider-response.test.js @@ -14,21 +14,18 @@ describe('video-slider-response plugin', function(){ expect(typeof window.jsPsych.plugins['video-slider-response']).not.toBe('undefined'); }); - test('video preloading initiates automatically', function(){ + test('video preloading registers correctly', function(){ const preload_spy = jest.spyOn(jsPsych.pluginAPI, 'registerPreload'); - const console_spy = jest.spyOn(console, 'warn'); require(root + 'plugins/jspsych-video-slider-response.js'); var trial = { type: 'video-slider-response', - stimulus: [root + 'tests/media/sample_video.mp4'] + stimulus: ['video.mp4'] } jsPsych.init({ timeline: [trial] }); expect(preload_spy).toHaveBeenCalled(); - expect(console_spy).not.toHaveBeenCalledWith('jsPsych failed to auto preload one or more files:'); preload_spy.mockRestore(); - console_spy.mockRestore(); }); });