mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 08:38:11 +00:00
add fullscreen partial test
This commit is contained in:
parent
87e064d9c9
commit
2a900c7d3e
41
tests/plugins/plugin-fullscreen.test.js
Normal file
41
tests/plugins/plugin-fullscreen.test.js
Normal file
@ -0,0 +1,41 @@
|
||||
const root = '../../';
|
||||
|
||||
jest.useFakeTimers();
|
||||
|
||||
describe('fullscreen plugin', function(){
|
||||
|
||||
beforeEach(function(){
|
||||
require(root + 'jspsych.js');
|
||||
require(root + 'plugins/jspsych-fullscreen.js');
|
||||
require(root + 'plugins/jspsych-text.js');
|
||||
});
|
||||
|
||||
test('loads correctly', function(){
|
||||
expect(typeof window.jsPsych.plugins['fullscreen']).not.toBe('undefined');
|
||||
});
|
||||
|
||||
// can't test this right now because jsdom doesn't support fullscreen API.
|
||||
|
||||
/*test('launches fullscreen mode by default', function(){
|
||||
var trial = {
|
||||
type: 'fullscreen',
|
||||
delay_after: 0
|
||||
}
|
||||
|
||||
var text = {
|
||||
type: 'text',
|
||||
text: 'fullscreen'
|
||||
}
|
||||
|
||||
jsPsych.init({
|
||||
timeline: [trial, text]
|
||||
});
|
||||
|
||||
expect(document.fullscreenElement).toBeUndefined();
|
||||
console.log(jsPsych.getDisplayElement().requestFullscreen);
|
||||
document.querySelector('#jspsych-fullscreen-btn').dispatchEvent(new MouseEvent('click', {}));
|
||||
|
||||
expect(document.fullscreenElement).not.toBeUndefined();
|
||||
});*/
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user