mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 16:48:12 +00:00
Merge pull request #1129 from becky-gilbert/timeline-tests
New test for nested timelines with no other parameters
This commit is contained in:
commit
94d4403be6
@ -348,6 +348,38 @@ describe('endCurrentTimeline', function(){
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
describe('nested timelines', function() {
|
||||||
|
test('works without other parameters', function() {
|
||||||
|
var t1 = {
|
||||||
|
type: 'html-keyboard-response',
|
||||||
|
stimulus: 'foo'
|
||||||
|
};
|
||||||
|
|
||||||
|
var t2 = {
|
||||||
|
type: 'html-keyboard-response',
|
||||||
|
stimulus: 'bar'
|
||||||
|
};
|
||||||
|
|
||||||
|
var trials = {
|
||||||
|
timeline: [t1, t2]
|
||||||
|
};
|
||||||
|
|
||||||
|
jsPsych.init({
|
||||||
|
timeline: [trials]
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(jsPsych.getDisplayElement().innerHTML).toMatch('foo');
|
||||||
|
|
||||||
|
utils.pressKey(32);
|
||||||
|
|
||||||
|
expect(jsPsych.getDisplayElement().innerHTML).toMatch('bar');
|
||||||
|
|
||||||
|
utils.pressKey(32);
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('add node to end of timeline', function(){
|
describe('add node to end of timeline', function(){
|
||||||
|
|
||||||
test('adds node to end of timeline, without callback', function() {
|
test('adds node to end of timeline, without callback', function() {
|
||||||
@ -407,3 +439,4 @@ describe('add node to end of timeline', function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user