remove auto_preload: false in jsPsych.init from tests because preloading is moved to plugin

This commit is contained in:
Becky Gilbert 2021-02-11 14:25:31 -08:00
parent 9729cd99ef
commit 470c0d4c5f
7 changed files with 53 additions and 107 deletions

View File

@ -25,8 +25,7 @@ describe('animation plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch('<img src="img/face_1.jpg" id="jspsych-animation-image"></img>');

View File

@ -23,8 +23,7 @@ describe('categorize-animation plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
jest.runTimersToTime(500);
@ -43,8 +42,7 @@ describe('categorize-animation plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
jest.runTimersToTime(1500);
@ -62,8 +60,7 @@ describe('categorize-animation plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
jest.runTimersToTime(1500);
@ -83,8 +80,7 @@ describe('categorize-animation plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
jest.runTimersToTime(1500);
@ -107,8 +103,7 @@ describe('categorize-animation plugin', function(){
};
jsPsych.init({
timeline: [trials],
auto_preload: false
timeline: [trials]
});
jest.runTimersToTime(1500);
@ -130,8 +125,7 @@ describe('categorize-animation plugin', function(){
};
jsPsych.init({
timeline: [trials],
auto_preload: false
timeline: [trials]
});
jest.runTimersToTime(1500);
@ -153,8 +147,7 @@ describe('categorize-animation plugin', function(){
};
jsPsych.init({
timeline: [trials],
auto_preload: false
timeline: [trials]
});
jest.runTimersToTime(1500);
@ -177,8 +170,7 @@ describe('categorize-animation plugin', function(){
};
jsPsych.init({
timeline: [trials],
auto_preload: false
timeline: [trials]
});
jest.runTimersToTime(1000);
@ -204,8 +196,7 @@ describe('categorize-animation plugin', function(){
};
jsPsych.init({
timeline: [trials],
auto_preload: false
timeline: [trials]
});
jest.runTimersToTime(1000);
@ -234,8 +225,7 @@ describe('categorize-animation plugin', function(){
};
jsPsych.init({
timeline: [trials],
auto_preload: false
timeline: [trials]
});
jest.runTimersToTime(1500);
@ -259,8 +249,7 @@ describe('categorize-animation plugin', function(){
};
jsPsych.init({
timeline: [trials],
auto_preload: false
timeline: [trials]
});
jest.runTimersToTime(1500);

View File

@ -20,8 +20,7 @@ describe('free-sort plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch(new RegExp('src=\"img/happy_face_1.jpg\" data-src=\"img/happy_face_1.jpg\"'));
@ -39,8 +38,7 @@ describe('free-sort plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch(new RegExp('class=\"jspsych-free-sort-arena\" style=\"position: relative; width:700px; height:500px;'));
@ -55,8 +53,7 @@ describe('free-sort plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch(new RegExp('<img src=\"img/happy_face_1.jpg\".+width:200px; height:200px'));
@ -70,8 +67,7 @@ describe('free-sort plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch(new RegExp('<p>This is a prompt</p>'));
@ -86,8 +82,7 @@ describe('free-sort plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch(new RegExp('<p>This is a prompt</p>.+<button id=\"jspsych-free-sort-done-btn\"'));
@ -102,8 +97,7 @@ describe('free-sort plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch(new RegExp('<button id=\"jspsych-free-sort-done-btn\" class=\"jspsych-btn\".+>Finito</button>'));

View File

@ -29,8 +29,7 @@ describe('iat-image plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch(/blue.png/);
@ -51,8 +50,7 @@ describe('iat-image plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
utils.pressKey('j');
@ -73,8 +71,7 @@ describe('iat-image plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
utils.pressKey('f');
@ -98,8 +95,7 @@ describe('iat-image plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
utils.pressKey('f');
@ -123,8 +119,7 @@ describe('iat-image plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
utils.pressKey('j');
@ -148,8 +143,7 @@ describe('iat-image plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch(new RegExp('<p>Press j for:<br> <b>UNFRIENDLY</b>'));
@ -176,8 +170,7 @@ describe('iat-image plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().querySelector('#wrongImgContainer').style.visibility).toBe('hidden');
@ -200,8 +193,7 @@ describe('iat-image plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch(new RegExp('<img src=\"../media/blue.png\" id=\"jspsych-iat-stim\">'));
@ -227,8 +219,7 @@ describe('iat-image plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
utils.pressKey('f');
@ -254,8 +245,7 @@ describe('iat-image plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch(new RegExp('<img src="../media/blue.png" id=\"jspsych-iat-stim\">'));
@ -288,8 +278,7 @@ describe('iat-image plugin', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch(new RegExp('<img src="../media/blue.png" id=\"jspsych-iat-stim\">'));

View File

@ -23,8 +23,7 @@ describe('image-button-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch('<img src="../media/blue.png"');
@ -39,8 +38,7 @@ describe('image-button-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch(new RegExp('<button class=\"jspsych-btn\">button-choice1</button>'));
@ -57,8 +55,7 @@ describe('image-button-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch(new RegExp('<button class="jspsych-custom-button">buttonChoice</button>'));
@ -73,8 +70,7 @@ describe('image-button-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch('<img src="../media/blue.png" id="jspsych-image-button-response-stimulus"');
@ -94,8 +90,7 @@ describe('image-button-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch('<button class=\"jspsych-btn\">button-choice</button></div></div><p>This is a prompt</p>');
@ -111,8 +106,7 @@ describe('image-button-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().querySelector('#jspsych-image-button-response-stimulus').style.visibility).toMatch("");
@ -130,8 +124,7 @@ describe('image-button-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch('<img src="../media/blue.png" id="jspsych-image-button-response-stimulus"');
@ -149,8 +142,7 @@ describe('image-button-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch('<img src="../media/blue.png" id="jspsych-image-button-response-stimulus"');
@ -173,8 +165,7 @@ describe('image-button-response', function(){
};
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(spy).toHaveBeenCalled();

View File

@ -22,8 +22,7 @@ describe('image-keyboard-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch('<img src=\"../media/blue.png\" id=\"jspsych-image-keyboard-response-stimulus\"');
@ -40,8 +39,7 @@ describe('image-keyboard-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch('<img src="../media/blue.png" id="jspsych-image-keyboard-response-stimulus"');
@ -61,8 +59,7 @@ describe('image-keyboard-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch('<div id="foo">this is a prompt</div>');
@ -79,8 +76,7 @@ describe('image-keyboard-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().querySelector('#jspsych-image-keyboard-response-stimulus').style.visibility).toMatch("");
@ -100,8 +96,7 @@ describe('image-keyboard-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch('<img src="../media/blue.png" id="jspsych-image-keyboard-response-stimulus"');
@ -119,8 +114,7 @@ describe('image-keyboard-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch('<img src="../media/blue.png" id="jspsych-image-keyboard-response-stimulus"');
@ -144,8 +138,7 @@ describe('image-keyboard-response', function(){
};
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(spy).toHaveBeenCalled();

View File

@ -29,8 +29,7 @@ describe('image-slider-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
});
@ -44,8 +43,7 @@ describe('image-slider-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch('<span style=\"text-align: center; font-size: 80%;\">left</span>');
@ -64,8 +62,7 @@ describe('image-slider-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch('<button id=\"jspsych-image-slider-response-next\" class=\"jspsych-btn\">button</button>');
@ -86,8 +83,7 @@ describe('image-slider-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().querySelector('#jspsych-image-slider-response-response').min).toBe('2');
@ -108,8 +104,7 @@ describe('image-slider-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch('<p>This is a prompt</p>');
@ -128,8 +123,7 @@ describe('image-slider-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().querySelector('#jspsych-image-slider-response-stimulus').style.visibility).toMatch("");
@ -146,12 +140,10 @@ describe('image-slider-response', function(){
button_label: 'button',
trial_duration: 500,
render_on_canvas: false
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch('<div id="jspsych-image-slider-response-stimulus"><img src="../media/blue.png"');
@ -170,8 +162,7 @@ describe('image-slider-response', function(){
}
jsPsych.init({
timeline: [trial],
auto_preload: false
timeline: [trial]
});
expect(jsPsych.getDisplayElement().innerHTML).toMatch('<div id="jspsych-image-slider-response-stimulus"><img src="../media/blue.png"');