fix tests for addNodeToEndOfTimeline (no longer accepts callback)

This commit is contained in:
Becky Gilbert 2021-02-09 14:18:31 -08:00
parent c8298e226f
commit a106dbbd13

View File

@ -438,7 +438,7 @@ describe('nested timelines', function() {
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', function() {
var new_trial = { var new_trial = {
type: 'html-keyboard-response', type: 'html-keyboard-response',
stimulus: 'bar' stimulus: 'bar'
@ -468,31 +468,5 @@ describe('add node to end of timeline', function(){
utils.pressKey('a'); utils.pressKey('a');
}); });
test('adds node to end of timeline, with callback', function() {
var t = {
type: 'html-keyboard-response',
stimulus: 'foo',
on_finish: function(){
jsPsych.pauseExperiment();
jsPsych.addNodeToEndOfTimeline({
timeline: [{
type: 'html-keyboard-response',
stimulus: 'bar'
}]
}, jsPsych.resumeExperiment)
}
};
jsPsych.init({
timeline: [t]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch('foo');
utils.pressKey('a');
expect(jsPsych.getDisplayElement().innerHTML).toMatch('bar');
utils.pressKey('a');
});
}); });