mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 08:38:11 +00:00
add broken test for #391
This commit is contained in:
parent
6ddd202bde
commit
e12e9e0d7a
@ -106,4 +106,48 @@ describe('The data parameter', function(){
|
||||
//resolve();
|
||||
})).then(function(data) { expect(data).toBe(2) });
|
||||
});
|
||||
|
||||
test('should record data to all nested trials with timeline variables even when nested trials have own data', function(){
|
||||
|
||||
require(root + 'jspsych.js');
|
||||
require(root + 'plugins/jspsych-text.js');
|
||||
|
||||
return (new Promise(function(resolve, reject){
|
||||
|
||||
var key_data = null;
|
||||
|
||||
var vars = [
|
||||
{text: 'a'},
|
||||
{text: 'b'}
|
||||
];
|
||||
|
||||
var trial = {
|
||||
timeline: [
|
||||
{
|
||||
type: 'text',
|
||||
text: jsPsych.timelineVariable('text'),
|
||||
data: {foo: 1}
|
||||
}
|
||||
],
|
||||
timeline_variables: vars,
|
||||
data: {added: true},
|
||||
}
|
||||
|
||||
jsPsych.init({
|
||||
timeline: [trial],
|
||||
on_finish: function() {
|
||||
var d = jsPsych.data.get().filter({added: true}).count();
|
||||
resolve(d);
|
||||
}
|
||||
});
|
||||
|
||||
document.querySelector('.jspsych-display-element').dispatchEvent(new KeyboardEvent('keydown', {keyCode: 32}));
|
||||
document.querySelector('.jspsych-display-element').dispatchEvent(new KeyboardEvent('keyup', {keyCode: 32}));
|
||||
|
||||
document.querySelector('.jspsych-display-element').dispatchEvent(new KeyboardEvent('keydown', {keyCode: 32}));
|
||||
document.querySelector('.jspsych-display-element').dispatchEvent(new KeyboardEvent('keyup', {keyCode: 32}));
|
||||
|
||||
//resolve();
|
||||
})).then(function(data) { expect(data).toBe(2) });
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user