Skip to content

Commit 5873460

Browse files
committed
fix tests
1 parent 76421f3 commit 5873460

2 files changed

Lines changed: 813 additions & 802 deletions

File tree

packages/math-inline/src/__tests__/main.test.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import Main from '../main';
44
import { mq, HorizontalKeypad } from '@pie-lib/pie-toolbox/math-input';
55
import { shallowChild } from '@pie-lib/pie-toolbox/test-utils';
66
import { Feedback } from '@pie-lib/pie-toolbox/render-ui';
7-
import {CorrectAnswerToggle} from '@pie-lib/pie-toolbox/correct-answer-toggle';
7+
import { CorrectAnswerToggle } from '@pie-lib/pie-toolbox/correct-answer-toggle';
88
import SimpleQuestionBlock from '../simple-question-block';
9+
import { mount } from 'enzyme';
910

1011
const Mathquill = require('@pie-framework/mathquill');
1112

@@ -97,6 +98,7 @@ describe('Math-Inline Main', () => {
9798
},
9899
},
99100
showCorrect: false,
101+
tooltipContainerRef: expect.any(Object),
100102
});
101103

102104
expect(Mathquill.getInterface().registerEmbed).toHaveBeenCalled();
@@ -148,6 +150,7 @@ describe('Math-Inline Main', () => {
148150
},
149151
},
150152
showCorrect: false,
153+
tooltipContainerRef: expect.any(Object),
151154
});
152155
});
153156

@@ -157,7 +160,9 @@ describe('Math-Inline Main', () => {
157160
expect(wrapper.find(HorizontalKeypad).length).toEqual(0);
158161
wrapper.instance().onSubFieldFocus('r1');
159162
wrapper.instance().onBlur({
160-
relatedTarget: { offsetParent: { getAttribute: () => 'tooltip', children: [{ attributes: { 'data-keypad': true } }] } },
163+
relatedTarget: {
164+
offsetParent: { getAttribute: () => 'tooltip', children: [{ attributes: { 'data-keypad': true } }] },
165+
},
161166
currentTarget: { offsetParent: 'editor1' },
162167
});
163168
expect(wrapper.state().activeAnswerBlock).toEqual('r1');
@@ -168,7 +173,9 @@ describe('Math-Inline Main', () => {
168173

169174
expect(wrapper.find(HorizontalKeypad).length).toEqual(0);
170175
wrapper.instance().onBlur({
171-
relatedTarget: { offsetParent: { getAttribute: () => 'tooltip', children: [{ attributes: { 'data-keypad': false } }] } },
176+
relatedTarget: {
177+
offsetParent: { getAttribute: () => 'tooltip', children: [{ attributes: { 'data-keypad': false } }] },
178+
},
172179
currentTarget: { offsetParent: 'editor2' },
173180
});
174181
expect(wrapper.state().activeAnswerBlock).toEqual('');
@@ -203,6 +210,7 @@ describe('Math-Inline Main', () => {
203210
},
204211
},
205212
showCorrect: false,
213+
tooltipContainerRef: expect.any(Object),
206214
});
207215
});
208216

@@ -229,6 +237,7 @@ describe('Math-Inline Main', () => {
229237
},
230238
},
231239
showCorrect: false,
240+
tooltipContainerRef: expect.any(Object),
232241
});
233242
});
234243

@@ -254,6 +263,7 @@ describe('Math-Inline Main', () => {
254263
},
255264
},
256265
showCorrect: false,
266+
tooltipContainerRef: expect.any(Object),
257267
});
258268

259269
const newProps = { ...defaultProps };
@@ -281,6 +291,7 @@ describe('Math-Inline Main', () => {
281291
},
282292
},
283293
showCorrect: false,
294+
tooltipContainerRef: expect.any(Object),
284295
});
285296
});
286297
});

0 commit comments

Comments
 (0)