mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-11 03:30:54 +00:00
15 lines
692 B
TypeScript
15 lines
692 B
TypeScript
import { JsPsych } from "src";
|
|
|
|
export function mockDomRelatedJsPsychMethods(jsPsychInstance: JsPsych) {
|
|
const displayElement = document.createElement("div");
|
|
const displayContainerElement = document.createElement("div");
|
|
jest.spyOn(jsPsychInstance, "getDisplayElement").mockImplementation(() => displayElement);
|
|
jest
|
|
.spyOn(jsPsychInstance, "getDisplayContainerElement")
|
|
.mockImplementation(() => displayContainerElement);
|
|
|
|
jest.spyOn(jsPsychInstance, "focusDisplayContainerElement").mockImplementation(() => {});
|
|
jest.spyOn(jsPsychInstance, "addCssClasses").mockImplementation(() => {});
|
|
jest.spyOn(jsPsychInstance, "removeCssClasses").mockImplementation(() => {});
|
|
}
|