diff --git a/tests/jsPsych/default-parameters.test.js b/tests/jsPsych/default-parameters.test.js new file mode 100644 index 00000000..66b9a290 --- /dev/null +++ b/tests/jsPsych/default-parameters.test.js @@ -0,0 +1,30 @@ +const root = '../../'; +const utils = require('../testing-utils.js'); + +beforeEach(function(){ + require(root + 'jspsych.js'); + require(root + 'plugins/jspsych-survey-text.js'); +}); + +describe('nested defaults', function(){ + test('work in basic situation', function(){ + var t = { + type: 'survey-text', + questions: [ + { + prompt: 'Question 1.' + }, + { + prompt: 'Question 2.' + } + ] + } + + jsPsych.init({timeline: [t]}) + + var display = jsPsych.getDisplayElement(); + + expect(display.querySelector('input').placeholder).toBe("") + expect(display.querySelector('input').size).toBe(40) + }); +}) \ No newline at end of file