mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 08:38:11 +00:00
shell of interaction data tests #350
This commit is contained in:
parent
2bdf031b40
commit
6ddd202bde
71
tests/jsPsych.data/interactions.test.js
Normal file
71
tests/jsPsych.data/interactions.test.js
Normal file
@ -0,0 +1,71 @@
|
||||
const root = '../../';
|
||||
|
||||
require(root + 'jspsych.js');
|
||||
|
||||
require(root + 'plugins/jspsych-text.js');
|
||||
|
||||
describe('Data recording', function(){
|
||||
|
||||
xtest('record focus events', function(){
|
||||
var timeline = [
|
||||
{type: 'text', text:'hello'}
|
||||
];
|
||||
jsPsych.init({timeline:timeline});
|
||||
// click through first trial
|
||||
document.querySelector('.jspsych-display-element').dispatchEvent(new KeyboardEvent('keydown', {keyCode: 32}));
|
||||
document.querySelector('.jspsych-display-element').dispatchEvent(new KeyboardEvent('keyup', {keyCode: 32}));
|
||||
// check if data contains rt
|
||||
})
|
||||
|
||||
xtest('record blur events', function(){
|
||||
var timeline = [
|
||||
{type: 'text', text:'hello'}
|
||||
];
|
||||
jsPsych.init({timeline:timeline});
|
||||
// click through first trial
|
||||
document.querySelector('.jspsych-display-element').dispatchEvent(new KeyboardEvent('keydown', {keyCode: 32}));
|
||||
document.querySelector('.jspsych-display-element').dispatchEvent(new KeyboardEvent('keyup', {keyCode: 32}));
|
||||
// check if data contains rt
|
||||
})
|
||||
|
||||
xtest('record fullscreenenter events', function(){
|
||||
var timeline = [
|
||||
{type: 'text', text:'hello'}
|
||||
];
|
||||
jsPsych.init({timeline:timeline});
|
||||
// click through first trial
|
||||
document.querySelector('.jspsych-display-element').dispatchEvent(new KeyboardEvent('keydown', {keyCode: 32}));
|
||||
document.querySelector('.jspsych-display-element').dispatchEvent(new KeyboardEvent('keyup', {keyCode: 32}));
|
||||
// check if data contains rt
|
||||
})
|
||||
|
||||
xtest('record fullscreenexit events', function(){
|
||||
var timeline = [
|
||||
{type: 'text', text:'hello'}
|
||||
];
|
||||
jsPsych.init({timeline:timeline});
|
||||
// click through first trial
|
||||
document.querySelector('.jspsych-display-element').dispatchEvent(new KeyboardEvent('keydown', {keyCode: 32}));
|
||||
document.querySelector('.jspsych-display-element').dispatchEvent(new KeyboardEvent('keyup', {keyCode: 32}));
|
||||
// check if data contains rt
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
describe('on_interaction_data_update', function(){
|
||||
xtest('fires for blur', function(){
|
||||
|
||||
});
|
||||
|
||||
xtest('fires for focus', function(){
|
||||
|
||||
})
|
||||
|
||||
xtest('fires for fullscreenexit', function(){
|
||||
|
||||
})
|
||||
|
||||
xtest('fires for fullscreenenter', function(){
|
||||
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue
Block a user