@pie-lib/math-input-mathlive 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/keys/misc.js +9 -2
- package/lib/keys/misc.js.map +1 -1
- package/lib/latex-bridge.js +30 -0
- package/lib/latex-bridge.js.map +1 -1
- package/lib/mathlive-instance.js +67 -3
- package/lib/mathlive-instance.js.map +1 -1
- package/lib/mf/input.js +7 -0
- package/lib/mf/input.js.map +1 -1
- package/lib/mf/static.js +82 -1
- package/lib/mf/static.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/keypad-label.test.jsx +58 -5
- package/src/__tests__/latex-bridge.test.js +22 -0
- package/src/__tests__/mathlive-instance.test.js +128 -0
- package/src/__tests__/mount-race.test.jsx +1 -0
- package/src/__tests__/static-prompts.test.jsx +113 -0
- package/src/keys/misc.js +8 -2
- package/src/latex-bridge.js +34 -0
- package/src/mathlive-instance.js +75 -1
- package/src/mf/input.jsx +15 -1
- package/src/mf/static.jsx +94 -2
- package/lib/__tests__/composites.test.js +0 -255
- package/lib/__tests__/composites.test.js.map +0 -1
- package/lib/__tests__/drop-in-compat.test.js +0 -133
- package/lib/__tests__/drop-in-compat.test.js.map +0 -1
- package/lib/__tests__/index.test.js +0 -118
- package/lib/__tests__/index.test.js.map +0 -1
- package/lib/__tests__/input-imperative.test.js +0 -155
- package/lib/__tests__/input-imperative.test.js.map +0 -1
- package/lib/__tests__/keypad-label.test.js +0 -118
- package/lib/__tests__/keypad-label.test.js.map +0 -1
- package/lib/__tests__/keypad-render.test.js +0 -206
- package/lib/__tests__/keypad-render.test.js.map +0 -1
- package/lib/__tests__/latex-bridge.test.js +0 -280
- package/lib/__tests__/latex-bridge.test.js.map +0 -1
- package/lib/__tests__/mathlive-instance.test.js +0 -279
- package/lib/__tests__/mathlive-instance.test.js.map +0 -1
- package/lib/__tests__/mount-race.test.js +0 -195
- package/lib/__tests__/mount-race.test.js.map +0 -1
- package/lib/__tests__/static-prompts.test.js +0 -282
- package/lib/__tests__/static-prompts.test.js.map +0 -1
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
5
|
-
describe('mathlive-instance', function () {
|
|
6
|
-
var instance;
|
|
7
|
-
beforeEach(function () {
|
|
8
|
-
jest.resetModules();
|
|
9
|
-
// eslint-disable-next-line global-require
|
|
10
|
-
instance = require('../mathlive-instance');
|
|
11
|
-
instance.__resetEmbeds();
|
|
12
|
-
});
|
|
13
|
-
describe('registerEmbed', function () {
|
|
14
|
-
it('registers a known embed and exposes it as a macro', function () {
|
|
15
|
-
instance.registerEmbed('answerBlock', function () {
|
|
16
|
-
return {
|
|
17
|
-
htmlString: '<div class="answerBlock"></div>',
|
|
18
|
-
latex: function latex() {
|
|
19
|
-
return '\\embed{answerBlock}[]';
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
expect(instance.registeredEmbeds()).toEqual(['answerBlock']);
|
|
24
|
-
// The macro tags output with data-embed so CSS can target it, replacing
|
|
25
|
-
// MathQuill's htmlString hook.
|
|
26
|
-
expect(instance.getMacros().answerBlock).toEqual('\\htmlData{embed=answerBlock}{\\placeholder{}}');
|
|
27
|
-
});
|
|
28
|
-
it('registers newLine as a harmless macro (it is handled by latex-bridge)', function () {
|
|
29
|
-
instance.registerEmbed('newLine', function () {
|
|
30
|
-
return {
|
|
31
|
-
latex: function latex() {
|
|
32
|
-
return '\\embed{newLine}[]';
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
expect(instance.getMacros().newLine).toEqual('\\htmlData{embed=newLine}{}');
|
|
37
|
-
});
|
|
38
|
-
it('falls back to a placeholder for an unknown embed', function () {
|
|
39
|
-
instance.registerEmbed('somethingCustom', function () {
|
|
40
|
-
return {
|
|
41
|
-
htmlString: '<b>x</b>'
|
|
42
|
-
};
|
|
43
|
-
});
|
|
44
|
-
expect(instance.getMacros().somethingCustom).toEqual('\\htmlData{embed=somethingCustom}{\\placeholder{}}');
|
|
45
|
-
});
|
|
46
|
-
it('honours an explicit mathliveLatex from the factory', function () {
|
|
47
|
-
instance.registerEmbed('custom', function () {
|
|
48
|
-
return {
|
|
49
|
-
mathliveLatex: '\\alpha'
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
expect(instance.getMacros().custom).toEqual('\\htmlData{embed=custom}{\\alpha}');
|
|
53
|
-
});
|
|
54
|
-
it('does not throw when the factory throws', function () {
|
|
55
|
-
expect(function () {
|
|
56
|
-
return instance.registerEmbed('bad', function () {
|
|
57
|
-
throw new Error('boom');
|
|
58
|
-
});
|
|
59
|
-
}).not.toThrow();
|
|
60
|
-
expect(instance.registeredEmbeds()).toEqual(['bad']);
|
|
61
|
-
});
|
|
62
|
-
it('ignores bad arguments', function () {
|
|
63
|
-
instance.registerEmbed(undefined, function () {
|
|
64
|
-
return {};
|
|
65
|
-
});
|
|
66
|
-
instance.registerEmbed('noFactory', undefined);
|
|
67
|
-
expect(instance.registeredEmbeds()).toEqual([]);
|
|
68
|
-
});
|
|
69
|
-
it('always includes the pie macro set', function () {
|
|
70
|
-
var macros = instance.getMacros();
|
|
71
|
-
expect(macros.parallelogram).toBeDefined();
|
|
72
|
-
expect(macros.longdiv).toBeDefined();
|
|
73
|
-
expect(macros.napprox).toEqual('\\not\\approx');
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
// Argument-taking macros exist only so previously authored latex parses.
|
|
77
|
-
// Editing never goes through them: MathLive serialises a macro from its
|
|
78
|
-
// original arguments, so typed content never comes back out.
|
|
79
|
-
it('argument-taking macros are plain parse-only definitions', function () {
|
|
80
|
-
['longdiv', 'overarc', 'abs'].forEach(function (name) {
|
|
81
|
-
expect((0, _typeof2["default"])(instance.PIE_MACROS[name])).toBe('string');
|
|
82
|
-
expect(instance.PIE_MACROS[name]).toContain('#1');
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
it('argument-less symbols stay atomic', function () {
|
|
86
|
-
['perpendicular', 'square', 'degree', 'napprox', 'parallelogram'].forEach(function (name) {
|
|
87
|
-
expect((0, _typeof2["default"])(instance.PIE_MACROS[name])).toBe('string');
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
it('longdiv matches the MathJax macro used by math-rendering', function () {
|
|
91
|
-
expect(instance.PIE_MACROS.longdiv).toEqual('\\enclose{longdiv}{#1}');
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
describe('applyStaticMath', function () {
|
|
95
|
-
it('returns undefined without an element', function () {
|
|
96
|
-
expect(instance.applyStaticMath(null, 'x')).toBeUndefined();
|
|
97
|
-
});
|
|
98
|
-
it('defers (returns undefined) when MathLive has not loaded', function () {
|
|
99
|
-
var el = document.createElement('div');
|
|
100
|
-
expect(instance.applyStaticMath(el, 'x')).toBeUndefined();
|
|
101
|
-
});
|
|
102
|
-
it('renders synchronously once MathLive is available', function () {
|
|
103
|
-
var el = document.createElement('div');
|
|
104
|
-
instance.__setMathLiveForTest({
|
|
105
|
-
convertLatexToMarkup: function convertLatexToMarkup(l) {
|
|
106
|
-
return "<span>".concat(l, "</span>");
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
expect(instance.applyStaticMath(el, '\\pi')).toBe(el);
|
|
110
|
-
expect(el.innerHTML).toEqual('<span>\\pi</span>');
|
|
111
|
-
});
|
|
112
|
-
it('falls back to the element textContent when no latex is passed', function () {
|
|
113
|
-
var el = document.createElement('div');
|
|
114
|
-
el.textContent = '\\theta';
|
|
115
|
-
instance.__setMathLiveForTest({
|
|
116
|
-
convertLatexToMarkup: function convertLatexToMarkup(l) {
|
|
117
|
-
return "<i>".concat(l, "</i>");
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
instance.applyStaticMath(el);
|
|
121
|
-
expect(el.innerHTML).toEqual('<i>\\theta</i>');
|
|
122
|
-
});
|
|
123
|
-
it('bridges stored latex (newLine embed) before rendering', function () {
|
|
124
|
-
var el = document.createElement('div');
|
|
125
|
-
instance.__setMathLiveForTest({
|
|
126
|
-
convertLatexToMarkup: function convertLatexToMarkup(l) {
|
|
127
|
-
return l;
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
instance.applyStaticMath(el, 'a\\embed{newLine}[]b');
|
|
131
|
-
|
|
132
|
-
// \embed{newLine}[] must become a multiline environment
|
|
133
|
-
expect(el.innerHTML).toContain('displaylines');
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
describe('configureFonts', function () {
|
|
137
|
-
// MathLive's default fontsDirectory is the relative './fonts/', which it
|
|
138
|
-
// resolves against its own (empty, when bundled) script url and throws
|
|
139
|
-
// "Invalid base URL" from loadFonts. Paths must become absolute.
|
|
140
|
-
it('is exported and callable before MathLive loads', function () {
|
|
141
|
-
expect((0, _typeof2["default"])(instance.configureFonts)).toBe('function');
|
|
142
|
-
expect(function () {
|
|
143
|
-
return instance.configureFonts('/mathlive-fonts');
|
|
144
|
-
}).not.toThrow();
|
|
145
|
-
});
|
|
146
|
-
it('accepts null to disable font loading', function () {
|
|
147
|
-
expect(function () {
|
|
148
|
-
return instance.configureFonts(null);
|
|
149
|
-
}).not.toThrow();
|
|
150
|
-
});
|
|
151
|
-
it('applies an absolute url to an already-loaded MathfieldElement', function () {
|
|
152
|
-
var MathfieldElement = {};
|
|
153
|
-
|
|
154
|
-
// simulate a loaded instance
|
|
155
|
-
instance.__setMathLiveForTest({
|
|
156
|
-
MathfieldElement: MathfieldElement
|
|
157
|
-
});
|
|
158
|
-
instance.configureFonts('/mathlive-fonts');
|
|
159
|
-
expect(MathfieldElement.fontsDirectory).toEqual("".concat(document.baseURI.replace(/\/$/, ''), "/mathlive-fonts"));
|
|
160
|
-
expect(MathfieldElement.fontsDirectory.startsWith('http')).toBe(true);
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
// \neq, \nsim and \ncong are built from Private Use Area glyphs that only
|
|
164
|
-
// the KaTeX fonts contain, so "no fonts" renders garbage rather than
|
|
165
|
-
// degrading gracefully - hence a CDN fallback by default.
|
|
166
|
-
it('falls back to a version-pinned CDN when nothing is configured', function () {
|
|
167
|
-
var MathfieldElement = {};
|
|
168
|
-
instance.__setMathLiveForTest({
|
|
169
|
-
MathfieldElement: MathfieldElement,
|
|
170
|
-
version: {
|
|
171
|
-
mathlive: '9.9.9'
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
instance.configureFonts(undefined);
|
|
175
|
-
expect(MathfieldElement.fontsDirectory).toEqual('https://unpkg.com/mathlive@9.9.9/fonts');
|
|
176
|
-
});
|
|
177
|
-
it('uses /fonts, not /dist/fonts (the latter 404s on unpkg)', function () {
|
|
178
|
-
var MathfieldElement = {};
|
|
179
|
-
instance.__setMathLiveForTest({
|
|
180
|
-
MathfieldElement: MathfieldElement,
|
|
181
|
-
version: {
|
|
182
|
-
mathlive: '0.110.0'
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
instance.configureFonts(undefined);
|
|
186
|
-
expect(MathfieldElement.fontsDirectory).toEqual('https://unpkg.com/mathlive@0.110.0/fonts');
|
|
187
|
-
expect(MathfieldElement.fontsDirectory).not.toContain('/dist/');
|
|
188
|
-
});
|
|
189
|
-
it('a configured path wins over the CDN', function () {
|
|
190
|
-
var MathfieldElement = {};
|
|
191
|
-
instance.__setMathLiveForTest({
|
|
192
|
-
MathfieldElement: MathfieldElement,
|
|
193
|
-
version: {
|
|
194
|
-
mathlive: '0.110.0'
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
instance.configureFonts('/mathlive-fonts');
|
|
198
|
-
expect(MathfieldElement.fontsDirectory).not.toContain('unpkg.com');
|
|
199
|
-
});
|
|
200
|
-
it('null still opts out entirely', function () {
|
|
201
|
-
var MathfieldElement = {};
|
|
202
|
-
instance.__setMathLiveForTest({
|
|
203
|
-
MathfieldElement: MathfieldElement,
|
|
204
|
-
version: {
|
|
205
|
-
mathlive: '0.110.0'
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
instance.configureFonts(null);
|
|
209
|
-
expect(MathfieldElement.fontsDirectory).toBeNull();
|
|
210
|
-
});
|
|
211
|
-
it('leaves a fully-qualified url untouched', function () {
|
|
212
|
-
var MathfieldElement = {};
|
|
213
|
-
instance.__setMathLiveForTest({
|
|
214
|
-
MathfieldElement: MathfieldElement
|
|
215
|
-
});
|
|
216
|
-
instance.configureFonts('https://cdn.example.com/fonts');
|
|
217
|
-
expect(MathfieldElement.fontsDirectory).toEqual('https://cdn.example.com/fonts');
|
|
218
|
-
});
|
|
219
|
-
it('passes null through rather than resolving it', function () {
|
|
220
|
-
var MathfieldElement = {};
|
|
221
|
-
instance.__setMathLiveForTest({
|
|
222
|
-
MathfieldElement: MathfieldElement
|
|
223
|
-
});
|
|
224
|
-
instance.configureFonts(null);
|
|
225
|
-
expect(MathfieldElement.fontsDirectory).toBeNull();
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
// A live <math-field> renders in shadow DOM, so nothing in the page's
|
|
230
|
-
// stylesheets reaches it - the stretchy-accent fix has to be injected there.
|
|
231
|
-
describe('applyShadowStyles', function () {
|
|
232
|
-
var host = function host() {
|
|
233
|
-
var el = document.createElement('div');
|
|
234
|
-
el.attachShadow({
|
|
235
|
-
mode: 'open'
|
|
236
|
-
});
|
|
237
|
-
return el;
|
|
238
|
-
};
|
|
239
|
-
it('is a no-op without a shadow root', function () {
|
|
240
|
-
expect(function () {
|
|
241
|
-
return instance.applyShadowStyles(undefined);
|
|
242
|
-
}).not.toThrow();
|
|
243
|
-
expect(function () {
|
|
244
|
-
return instance.applyShadowStyles(document.createElement('div'));
|
|
245
|
-
}).not.toThrow();
|
|
246
|
-
});
|
|
247
|
-
it('injects the accent fix into the shadow root', function () {
|
|
248
|
-
var el = host();
|
|
249
|
-
instance.applyShadowStyles(el);
|
|
250
|
-
var viaSheet = el.shadowRoot.__pieAccentSheet;
|
|
251
|
-
var viaStyle = el.shadowRoot.querySelector('style[data-pie-accent]');
|
|
252
|
-
var css = viaSheet ? 'adopted' : viaStyle && viaStyle.textContent || '';
|
|
253
|
-
expect(viaSheet || viaStyle).toBeTruthy();
|
|
254
|
-
if (viaStyle) {
|
|
255
|
-
expect(css).toContain('margin-left:0 !important');
|
|
256
|
-
// scoped so single-glyph accents keep their centring offset
|
|
257
|
-
expect(css).toContain(':has(.ML__stretchy)');
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
it('does not inject twice', function () {
|
|
261
|
-
var el = host();
|
|
262
|
-
instance.applyShadowStyles(el);
|
|
263
|
-
instance.applyShadowStyles(el);
|
|
264
|
-
var styles = el.shadowRoot.querySelectorAll('style[data-pie-accent]');
|
|
265
|
-
|
|
266
|
-
// either one adopted sheet, or exactly one style node
|
|
267
|
-
expect(el.shadowRoot.__pieAccentSheet ? 1 : styles.length).toBe(1);
|
|
268
|
-
});
|
|
269
|
-
});
|
|
270
|
-
describe('latexToMarkup', function () {
|
|
271
|
-
it('returns empty string when MathLive is not loaded', function () {
|
|
272
|
-
expect(instance.latexToMarkup('\\pi')).toEqual('');
|
|
273
|
-
});
|
|
274
|
-
it('returns empty string for empty latex', function () {
|
|
275
|
-
expect(instance.latexToMarkup('')).toEqual('');
|
|
276
|
-
});
|
|
277
|
-
});
|
|
278
|
-
});
|
|
279
|
-
//# sourceMappingURL=mathlive-instance.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mathlive-instance.test.js","names":["describe","instance","beforeEach","jest","resetModules","require","__resetEmbeds","it","registerEmbed","htmlString","latex","expect","registeredEmbeds","toEqual","getMacros","answerBlock","newLine","somethingCustom","mathliveLatex","custom","Error","not","toThrow","undefined","macros","parallelogram","toBeDefined","longdiv","napprox","forEach","name","_typeof2","PIE_MACROS","toBe","toContain","applyStaticMath","toBeUndefined","el","document","createElement","__setMathLiveForTest","convertLatexToMarkup","l","concat","innerHTML","textContent","configureFonts","MathfieldElement","fontsDirectory","baseURI","replace","startsWith","version","mathlive","toBeNull","host","attachShadow","mode","applyShadowStyles","viaSheet","shadowRoot","__pieAccentSheet","viaStyle","querySelector","css","toBeTruthy","styles","querySelectorAll","length","latexToMarkup"],"sources":["../../src/__tests__/mathlive-instance.test.js"],"sourcesContent":["describe('mathlive-instance', () => {\n let instance;\n\n beforeEach(() => {\n jest.resetModules();\n // eslint-disable-next-line global-require\n instance = require('../mathlive-instance');\n instance.__resetEmbeds();\n });\n\n describe('registerEmbed', () => {\n it('registers a known embed and exposes it as a macro', () => {\n instance.registerEmbed('answerBlock', () => ({\n htmlString: '<div class=\"answerBlock\"></div>',\n latex: () => '\\\\embed{answerBlock}[]',\n }));\n\n expect(instance.registeredEmbeds()).toEqual(['answerBlock']);\n // The macro tags output with data-embed so CSS can target it, replacing\n // MathQuill's htmlString hook.\n expect(instance.getMacros().answerBlock).toEqual('\\\\htmlData{embed=answerBlock}{\\\\placeholder{}}');\n });\n\n it('registers newLine as a harmless macro (it is handled by latex-bridge)', () => {\n instance.registerEmbed('newLine', () => ({ latex: () => '\\\\embed{newLine}[]' }));\n\n expect(instance.getMacros().newLine).toEqual('\\\\htmlData{embed=newLine}{}');\n });\n\n it('falls back to a placeholder for an unknown embed', () => {\n instance.registerEmbed('somethingCustom', () => ({ htmlString: '<b>x</b>' }));\n\n expect(instance.getMacros().somethingCustom).toEqual('\\\\htmlData{embed=somethingCustom}{\\\\placeholder{}}');\n });\n\n it('honours an explicit mathliveLatex from the factory', () => {\n instance.registerEmbed('custom', () => ({ mathliveLatex: '\\\\alpha' }));\n\n expect(instance.getMacros().custom).toEqual('\\\\htmlData{embed=custom}{\\\\alpha}');\n });\n\n it('does not throw when the factory throws', () => {\n expect(() =>\n instance.registerEmbed('bad', () => {\n throw new Error('boom');\n }),\n ).not.toThrow();\n\n expect(instance.registeredEmbeds()).toEqual(['bad']);\n });\n\n it('ignores bad arguments', () => {\n instance.registerEmbed(undefined, () => ({}));\n instance.registerEmbed('noFactory', undefined);\n\n expect(instance.registeredEmbeds()).toEqual([]);\n });\n\n it('always includes the pie macro set', () => {\n const macros = instance.getMacros();\n\n expect(macros.parallelogram).toBeDefined();\n expect(macros.longdiv).toBeDefined();\n expect(macros.napprox).toEqual('\\\\not\\\\approx');\n });\n\n // Argument-taking macros exist only so previously authored latex parses.\n // Editing never goes through them: MathLive serialises a macro from its\n // original arguments, so typed content never comes back out.\n it('argument-taking macros are plain parse-only definitions', () => {\n ['longdiv', 'overarc', 'abs'].forEach((name) => {\n expect(typeof instance.PIE_MACROS[name]).toBe('string');\n expect(instance.PIE_MACROS[name]).toContain('#1');\n });\n });\n\n it('argument-less symbols stay atomic', () => {\n ['perpendicular', 'square', 'degree', 'napprox', 'parallelogram'].forEach((name) => {\n expect(typeof instance.PIE_MACROS[name]).toBe('string');\n });\n });\n\n it('longdiv matches the MathJax macro used by math-rendering', () => {\n expect(instance.PIE_MACROS.longdiv).toEqual('\\\\enclose{longdiv}{#1}');\n });\n });\n\n describe('applyStaticMath', () => {\n it('returns undefined without an element', () => {\n expect(instance.applyStaticMath(null, 'x')).toBeUndefined();\n });\n\n it('defers (returns undefined) when MathLive has not loaded', () => {\n const el = document.createElement('div');\n\n expect(instance.applyStaticMath(el, 'x')).toBeUndefined();\n });\n\n it('renders synchronously once MathLive is available', () => {\n const el = document.createElement('div');\n\n instance.__setMathLiveForTest({ convertLatexToMarkup: (l) => `<span>${l}</span>` });\n\n expect(instance.applyStaticMath(el, '\\\\pi')).toBe(el);\n expect(el.innerHTML).toEqual('<span>\\\\pi</span>');\n });\n\n it('falls back to the element textContent when no latex is passed', () => {\n const el = document.createElement('div');\n\n el.textContent = '\\\\theta';\n instance.__setMathLiveForTest({ convertLatexToMarkup: (l) => `<i>${l}</i>` });\n instance.applyStaticMath(el);\n\n expect(el.innerHTML).toEqual('<i>\\\\theta</i>');\n });\n\n it('bridges stored latex (newLine embed) before rendering', () => {\n const el = document.createElement('div');\n\n instance.__setMathLiveForTest({ convertLatexToMarkup: (l) => l });\n instance.applyStaticMath(el, 'a\\\\embed{newLine}[]b');\n\n // \\embed{newLine}[] must become a multiline environment\n expect(el.innerHTML).toContain('displaylines');\n });\n });\n\n describe('configureFonts', () => {\n // MathLive's default fontsDirectory is the relative './fonts/', which it\n // resolves against its own (empty, when bundled) script url and throws\n // \"Invalid base URL\" from loadFonts. Paths must become absolute.\n it('is exported and callable before MathLive loads', () => {\n expect(typeof instance.configureFonts).toBe('function');\n expect(() => instance.configureFonts('/mathlive-fonts')).not.toThrow();\n });\n\n it('accepts null to disable font loading', () => {\n expect(() => instance.configureFonts(null)).not.toThrow();\n });\n\n it('applies an absolute url to an already-loaded MathfieldElement', () => {\n const MathfieldElement = {};\n\n // simulate a loaded instance\n instance.__setMathLiveForTest({ MathfieldElement });\n instance.configureFonts('/mathlive-fonts');\n\n expect(MathfieldElement.fontsDirectory).toEqual(`${document.baseURI.replace(/\\/$/, '')}/mathlive-fonts`);\n expect(MathfieldElement.fontsDirectory.startsWith('http')).toBe(true);\n });\n\n // \\neq, \\nsim and \\ncong are built from Private Use Area glyphs that only\n // the KaTeX fonts contain, so \"no fonts\" renders garbage rather than\n // degrading gracefully - hence a CDN fallback by default.\n it('falls back to a version-pinned CDN when nothing is configured', () => {\n const MathfieldElement = {};\n\n instance.__setMathLiveForTest({ MathfieldElement, version: { mathlive: '9.9.9' } });\n instance.configureFonts(undefined);\n\n expect(MathfieldElement.fontsDirectory).toEqual('https://unpkg.com/mathlive@9.9.9/fonts');\n });\n\n it('uses /fonts, not /dist/fonts (the latter 404s on unpkg)', () => {\n const MathfieldElement = {};\n\n instance.__setMathLiveForTest({ MathfieldElement, version: { mathlive: '0.110.0' } });\n instance.configureFonts(undefined);\n\n expect(MathfieldElement.fontsDirectory).toEqual('https://unpkg.com/mathlive@0.110.0/fonts');\n expect(MathfieldElement.fontsDirectory).not.toContain('/dist/');\n });\n\n it('a configured path wins over the CDN', () => {\n const MathfieldElement = {};\n\n instance.__setMathLiveForTest({ MathfieldElement, version: { mathlive: '0.110.0' } });\n instance.configureFonts('/mathlive-fonts');\n\n expect(MathfieldElement.fontsDirectory).not.toContain('unpkg.com');\n });\n\n it('null still opts out entirely', () => {\n const MathfieldElement = {};\n\n instance.__setMathLiveForTest({ MathfieldElement, version: { mathlive: '0.110.0' } });\n instance.configureFonts(null);\n\n expect(MathfieldElement.fontsDirectory).toBeNull();\n });\n\n it('leaves a fully-qualified url untouched', () => {\n const MathfieldElement = {};\n\n instance.__setMathLiveForTest({ MathfieldElement });\n instance.configureFonts('https://cdn.example.com/fonts');\n\n expect(MathfieldElement.fontsDirectory).toEqual('https://cdn.example.com/fonts');\n });\n\n it('passes null through rather than resolving it', () => {\n const MathfieldElement = {};\n\n instance.__setMathLiveForTest({ MathfieldElement });\n instance.configureFonts(null);\n\n expect(MathfieldElement.fontsDirectory).toBeNull();\n });\n });\n\n // A live <math-field> renders in shadow DOM, so nothing in the page's\n // stylesheets reaches it - the stretchy-accent fix has to be injected there.\n describe('applyShadowStyles', () => {\n const host = () => {\n const el = document.createElement('div');\n\n el.attachShadow({ mode: 'open' });\n\n return el;\n };\n\n it('is a no-op without a shadow root', () => {\n expect(() => instance.applyShadowStyles(undefined)).not.toThrow();\n expect(() => instance.applyShadowStyles(document.createElement('div'))).not.toThrow();\n });\n\n it('injects the accent fix into the shadow root', () => {\n const el = host();\n\n instance.applyShadowStyles(el);\n\n const viaSheet = el.shadowRoot.__pieAccentSheet;\n const viaStyle = el.shadowRoot.querySelector('style[data-pie-accent]');\n const css = viaSheet ? 'adopted' : (viaStyle && viaStyle.textContent) || '';\n\n expect(viaSheet || viaStyle).toBeTruthy();\n\n if (viaStyle) {\n expect(css).toContain('margin-left:0 !important');\n // scoped so single-glyph accents keep their centring offset\n expect(css).toContain(':has(.ML__stretchy)');\n }\n });\n\n it('does not inject twice', () => {\n const el = host();\n\n instance.applyShadowStyles(el);\n instance.applyShadowStyles(el);\n\n const styles = el.shadowRoot.querySelectorAll('style[data-pie-accent]');\n\n // either one adopted sheet, or exactly one style node\n expect(el.shadowRoot.__pieAccentSheet ? 1 : styles.length).toBe(1);\n });\n });\n\n describe('latexToMarkup', () => {\n it('returns empty string when MathLive is not loaded', () => {\n expect(instance.latexToMarkup('\\\\pi')).toEqual('');\n });\n\n it('returns empty string for empty latex', () => {\n expect(instance.latexToMarkup('')).toEqual('');\n });\n });\n});\n"],"mappings":";;;;AAAAA,QAAQ,CAAC,mBAAmB,EAAE,YAAM;EAClC,IAAIC,QAAQ;EAEZC,UAAU,CAAC,YAAM;IACfC,IAAI,CAACC,YAAY,CAAC,CAAC;IACnB;IACAH,QAAQ,GAAGI,OAAO,CAAC,sBAAsB,CAAC;IAC1CJ,QAAQ,CAACK,aAAa,CAAC,CAAC;EAC1B,CAAC,CAAC;EAEFN,QAAQ,CAAC,eAAe,EAAE,YAAM;IAC9BO,EAAE,CAAC,mDAAmD,EAAE,YAAM;MAC5DN,QAAQ,CAACO,aAAa,CAAC,aAAa,EAAE;QAAA,OAAO;UAC3CC,UAAU,EAAE,iCAAiC;UAC7CC,KAAK,EAAE,SAAPA,KAAKA,CAAA;YAAA,OAAQ,wBAAwB;UAAA;QACvC,CAAC;MAAA,CAAC,CAAC;MAEHC,MAAM,CAACV,QAAQ,CAACW,gBAAgB,CAAC,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC;MAC5D;MACA;MACAF,MAAM,CAACV,QAAQ,CAACa,SAAS,CAAC,CAAC,CAACC,WAAW,CAAC,CAACF,OAAO,CAAC,gDAAgD,CAAC;IACpG,CAAC,CAAC;IAEFN,EAAE,CAAC,uEAAuE,EAAE,YAAM;MAChFN,QAAQ,CAACO,aAAa,CAAC,SAAS,EAAE;QAAA,OAAO;UAAEE,KAAK,EAAE,SAAPA,KAAKA,CAAA;YAAA,OAAQ,oBAAoB;UAAA;QAAC,CAAC;MAAA,CAAC,C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C,CAAC9B,SAAS,CAAC,0BAA0B,CAAC;QACjD;QACAvB,MAAM,CAACqD,GAAG,CAAC,CAAC9B,SAAS,CAAC,qBAAqB,CAAC;MAC9C;IACF,CAAC,CAAC;IAEF3B,EAAE,CAAC,uBAAuB,EAAE,YAAM;MAChC,IAAM8B,EAAE,GAAGkB,IAAI,CAAC,CAAC;MAEjBtD,QAAQ,CAACyD,iBAAiB,CAACrB,EAAE,CAAC;MAC9BpC,QAAQ,CAACyD,iBAAiB,CAACrB,EAAE,CAAC;MAE9B,IAAM6B,MAAM,GAAG7B,EAAE,CAACuB,UAAU,CAACO,gBAAgB,CAAC,wBAAwB,CAAC;;MAEvE;MACAxD,MAAM,CAAC0B,EAAE,CAACuB,UAAU,CAACC,gBAAgB,GAAG,CAAC,GAAGK,MAAM,CAACE,MAAM,CAAC,CAACnC,IAAI,CAAC,CAAC,CAAC;IACpE,CAAC,CAAC;EACJ,CAAC,CAAC;EAEFjC,QAAQ,CAAC,eAAe,EAAE,YAAM;IAC9BO,EAAE,CAAC,kDAAkD,EAAE,YAAM;MAC3DI,MAAM,CAACV,QAAQ,CAACoE,aAAa,CAAC,MAAM,CAAC,CAAC,CAACxD,OAAO,CAAC,EAAE,CAAC;IACpD,CAAC,CAAC;IAEFN,EAAE,CAAC,sCAAsC,EAAE,YAAM;MAC/CI,MAAM,CAACV,QAAQ,CAACoE,aAAa,CAAC,EAAE,CAAC,CAAC,CAACxD,OAAO,CAAC,EAAE,CAAC;IAChD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
5
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
6
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
7
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
8
|
-
var _input = _interopRequireDefault(require("../mf/input"));
|
|
9
|
-
/**
|
|
10
|
-
* MathLive loads asynchronously, so `componentDidMount` resumes after an await
|
|
11
|
-
* before appending a <math-field>. Two orderings must both hold:
|
|
12
|
-
*
|
|
13
|
-
* - StrictMode dev double-mount (mount -> unmount -> mount on the SAME
|
|
14
|
-
* instance) must end up with exactly ONE field. A boolean "unmounted" flag
|
|
15
|
-
* latches here and blocks the remount entirely - which is why this uses a
|
|
16
|
-
* generation counter.
|
|
17
|
-
* - A genuine unmount while the load is in flight must append nothing.
|
|
18
|
-
*
|
|
19
|
-
* MathLive cannot load under jsdom, so it is mocked with a minimal stub in
|
|
20
|
-
* order to actually count appended fields.
|
|
21
|
-
*/
|
|
22
|
-
jest.mock('../mathlive-instance', function () {
|
|
23
|
-
// Must be a real DOM node: the component uses replaceChildren(), which
|
|
24
|
-
// rejects anything that is not a Node. Returning an element from the
|
|
25
|
-
// constructor replaces `this`, so callers get a genuine <math-field>.
|
|
26
|
-
var FakeMathfieldElement = /*#__PURE__*/(0, _createClass2["default"])(function FakeMathfieldElement() {
|
|
27
|
-
(0, _classCallCheck2["default"])(this, FakeMathfieldElement);
|
|
28
|
-
// `global` rather than `document`: jest forbids out-of-scope variables in
|
|
29
|
-
// a mock factory, and `global` is on its allow-list.
|
|
30
|
-
var el = global.document.createElement('math-field');
|
|
31
|
-
el.value = '';
|
|
32
|
-
el.getValue = function () {
|
|
33
|
-
return el.value;
|
|
34
|
-
};
|
|
35
|
-
return el;
|
|
36
|
-
});
|
|
37
|
-
return {
|
|
38
|
-
loadMathLive: function loadMathLive() {
|
|
39
|
-
return Promise.resolve({
|
|
40
|
-
MathfieldElement: FakeMathfieldElement
|
|
41
|
-
});
|
|
42
|
-
},
|
|
43
|
-
getMacros: function getMacros() {
|
|
44
|
-
return {};
|
|
45
|
-
},
|
|
46
|
-
// must mirror the real export, otherwise the component sets `undefined`
|
|
47
|
-
MATH_MODE_SPACE: '\\ ',
|
|
48
|
-
applyShadowStyles: function applyShadowStyles() {},
|
|
49
|
-
latexToMarkup: function latexToMarkup(l) {
|
|
50
|
-
return "<span>".concat(l, "</span>");
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
// eslint-disable-next-line import/first
|
|
56
|
-
|
|
57
|
-
var holderFor = function holderFor(cmp) {
|
|
58
|
-
var el = document.createElement('span');
|
|
59
|
-
cmp.holderRef = {
|
|
60
|
-
current: el
|
|
61
|
-
};
|
|
62
|
-
return el;
|
|
63
|
-
};
|
|
64
|
-
var fieldCount = function fieldCount(el) {
|
|
65
|
-
return Array.from(el.childNodes).filter(function (n) {
|
|
66
|
-
return n.tagName === 'MATH-FIELD';
|
|
67
|
-
}).length;
|
|
68
|
-
};
|
|
69
|
-
describe('async mount race', function () {
|
|
70
|
-
it('StrictMode mount -> unmount -> mount yields exactly one field', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
71
|
-
var input, el, first, second;
|
|
72
|
-
return _regenerator["default"].wrap(function (_context) {
|
|
73
|
-
while (1) switch (_context.prev = _context.next) {
|
|
74
|
-
case 0:
|
|
75
|
-
input = new _input["default"]({});
|
|
76
|
-
el = holderFor(input);
|
|
77
|
-
first = input.componentDidMount();
|
|
78
|
-
input.componentWillUnmount();
|
|
79
|
-
second = input.componentDidMount();
|
|
80
|
-
_context.next = 1;
|
|
81
|
-
return Promise.all([first, second]);
|
|
82
|
-
case 1:
|
|
83
|
-
expect(fieldCount(el)).toBe(1);
|
|
84
|
-
expect(input.mathField).toBeDefined();
|
|
85
|
-
case 2:
|
|
86
|
-
case "end":
|
|
87
|
-
return _context.stop();
|
|
88
|
-
}
|
|
89
|
-
}, _callee);
|
|
90
|
-
})));
|
|
91
|
-
it('appends nothing when unmounted while the load is in flight', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
92
|
-
var input, el, pending;
|
|
93
|
-
return _regenerator["default"].wrap(function (_context2) {
|
|
94
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
95
|
-
case 0:
|
|
96
|
-
input = new _input["default"]({});
|
|
97
|
-
el = holderFor(input);
|
|
98
|
-
pending = input.componentDidMount();
|
|
99
|
-
input.componentWillUnmount();
|
|
100
|
-
_context2.next = 1;
|
|
101
|
-
return pending;
|
|
102
|
-
case 1:
|
|
103
|
-
expect(fieldCount(el)).toBe(0);
|
|
104
|
-
expect(input.mathField).toBeUndefined();
|
|
105
|
-
case 2:
|
|
106
|
-
case "end":
|
|
107
|
-
return _context2.stop();
|
|
108
|
-
}
|
|
109
|
-
}, _callee2);
|
|
110
|
-
})));
|
|
111
|
-
it('a normal single mount creates the field', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
112
|
-
var input, el;
|
|
113
|
-
return _regenerator["default"].wrap(function (_context3) {
|
|
114
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
115
|
-
case 0:
|
|
116
|
-
input = new _input["default"]({});
|
|
117
|
-
el = holderFor(input);
|
|
118
|
-
_context3.next = 1;
|
|
119
|
-
return input.componentDidMount();
|
|
120
|
-
case 1:
|
|
121
|
-
expect(fieldCount(el)).toBe(1);
|
|
122
|
-
case 2:
|
|
123
|
-
case "end":
|
|
124
|
-
return _context3.stop();
|
|
125
|
-
}
|
|
126
|
-
}, _callee3);
|
|
127
|
-
})));
|
|
128
|
-
it('repeated mounts never accumulate fields', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
129
|
-
var input, el;
|
|
130
|
-
return _regenerator["default"].wrap(function (_context4) {
|
|
131
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
132
|
-
case 0:
|
|
133
|
-
input = new _input["default"]({});
|
|
134
|
-
el = holderFor(input);
|
|
135
|
-
_context4.next = 1;
|
|
136
|
-
return input.componentDidMount();
|
|
137
|
-
case 1:
|
|
138
|
-
_context4.next = 2;
|
|
139
|
-
return input.componentDidMount();
|
|
140
|
-
case 2:
|
|
141
|
-
_context4.next = 3;
|
|
142
|
-
return input.componentDidMount();
|
|
143
|
-
case 3:
|
|
144
|
-
expect(fieldCount(el)).toBe(1);
|
|
145
|
-
case 4:
|
|
146
|
-
case "end":
|
|
147
|
-
return _context4.stop();
|
|
148
|
-
}
|
|
149
|
-
}, _callee4);
|
|
150
|
-
})));
|
|
151
|
-
|
|
152
|
-
// MathLive's mathModeSpace defaults to '', which makes the spacebar a no-op.
|
|
153
|
-
it('configures the spacebar so a space can be typed', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
|
154
|
-
var input;
|
|
155
|
-
return _regenerator["default"].wrap(function (_context5) {
|
|
156
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
157
|
-
case 0:
|
|
158
|
-
input = new _input["default"]({});
|
|
159
|
-
holderFor(input);
|
|
160
|
-
_context5.next = 1;
|
|
161
|
-
return input.componentDidMount();
|
|
162
|
-
case 1:
|
|
163
|
-
// a LaTeX control space - what MathQuill produced, and MathJax understands
|
|
164
|
-
expect(input.mathField.mathModeSpace).toEqual('\\ ');
|
|
165
|
-
expect(input.mathField.mathModeSpace).not.toEqual('');
|
|
166
|
-
case 2:
|
|
167
|
-
case "end":
|
|
168
|
-
return _context5.stop();
|
|
169
|
-
}
|
|
170
|
-
}, _callee5);
|
|
171
|
-
})));
|
|
172
|
-
it('reports itself through innerRef on mount and clears it on unmount', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
|
173
|
-
var innerRef, input;
|
|
174
|
-
return _regenerator["default"].wrap(function (_context6) {
|
|
175
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
176
|
-
case 0:
|
|
177
|
-
innerRef = jest.fn();
|
|
178
|
-
input = new _input["default"]({
|
|
179
|
-
innerRef: innerRef
|
|
180
|
-
});
|
|
181
|
-
holderFor(input);
|
|
182
|
-
_context6.next = 1;
|
|
183
|
-
return input.componentDidMount();
|
|
184
|
-
case 1:
|
|
185
|
-
expect(innerRef).toHaveBeenCalledWith(input);
|
|
186
|
-
input.componentWillUnmount();
|
|
187
|
-
expect(innerRef).toHaveBeenLastCalledWith(null);
|
|
188
|
-
case 2:
|
|
189
|
-
case "end":
|
|
190
|
-
return _context6.stop();
|
|
191
|
-
}
|
|
192
|
-
}, _callee6);
|
|
193
|
-
})));
|
|
194
|
-
});
|
|
195
|
-
//# sourceMappingURL=mount-race.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mount-race.test.js","names":["_input","_interopRequireDefault","require","jest","mock","FakeMathfieldElement","_createClass2","_classCallCheck2","el","global","document","createElement","value","getValue","loadMathLive","Promise","resolve","MathfieldElement","getMacros","MATH_MODE_SPACE","applyShadowStyles","latexToMarkup","l","concat","holderFor","cmp","holderRef","current","fieldCount","Array","from","childNodes","filter","n","tagName","length","describe","it","_asyncToGenerator2","_regenerator","mark","_callee","input","first","second","wrap","_context","prev","next","Input","componentDidMount","componentWillUnmount","all","expect","toBe","mathField","toBeDefined","stop","_callee2","pending","_context2","toBeUndefined","_callee3","_context3","_callee4","_context4","_callee5","_context5","mathModeSpace","toEqual","not","_callee6","innerRef","_context6","fn","toHaveBeenCalledWith","toHaveBeenLastCalledWith"],"sources":["../../src/__tests__/mount-race.test.jsx"],"sourcesContent":["/**\n * MathLive loads asynchronously, so `componentDidMount` resumes after an await\n * before appending a <math-field>. Two orderings must both hold:\n *\n * - StrictMode dev double-mount (mount -> unmount -> mount on the SAME\n * instance) must end up with exactly ONE field. A boolean \"unmounted\" flag\n * latches here and blocks the remount entirely - which is why this uses a\n * generation counter.\n * - A genuine unmount while the load is in flight must append nothing.\n *\n * MathLive cannot load under jsdom, so it is mocked with a minimal stub in\n * order to actually count appended fields.\n */\njest.mock('../mathlive-instance', () => {\n // Must be a real DOM node: the component uses replaceChildren(), which\n // rejects anything that is not a Node. Returning an element from the\n // constructor replaces `this`, so callers get a genuine <math-field>.\n class FakeMathfieldElement {\n constructor() {\n // `global` rather than `document`: jest forbids out-of-scope variables in\n // a mock factory, and `global` is on its allow-list.\n const el = global.document.createElement('math-field');\n\n el.value = '';\n el.getValue = () => el.value;\n\n return el;\n }\n }\n\n return {\n loadMathLive: () => Promise.resolve({ MathfieldElement: FakeMathfieldElement }),\n getMacros: () => ({}),\n // must mirror the real export, otherwise the component sets `undefined`\n MATH_MODE_SPACE: '\\\\ ',\n applyShadowStyles: () => {},\n latexToMarkup: (l) => `<span>${l}</span>`,\n };\n});\n\n// eslint-disable-next-line import/first\nimport Input from '../mf/input';\n\nconst holderFor = (cmp) => {\n const el = document.createElement('span');\n\n cmp.holderRef = { current: el };\n\n return el;\n};\n\nconst fieldCount = (el) => Array.from(el.childNodes).filter((n) => n.tagName === 'MATH-FIELD').length;\n\ndescribe('async mount race', () => {\n it('StrictMode mount -> unmount -> mount yields exactly one field', async () => {\n const input = new Input({});\n const el = holderFor(input);\n\n const first = input.componentDidMount();\n\n input.componentWillUnmount();\n\n const second = input.componentDidMount();\n\n await Promise.all([first, second]);\n\n expect(fieldCount(el)).toBe(1);\n expect(input.mathField).toBeDefined();\n });\n\n it('appends nothing when unmounted while the load is in flight', async () => {\n const input = new Input({});\n const el = holderFor(input);\n\n const pending = input.componentDidMount();\n\n input.componentWillUnmount();\n\n await pending;\n\n expect(fieldCount(el)).toBe(0);\n expect(input.mathField).toBeUndefined();\n });\n\n it('a normal single mount creates the field', async () => {\n const input = new Input({});\n const el = holderFor(input);\n\n await input.componentDidMount();\n\n expect(fieldCount(el)).toBe(1);\n });\n\n it('repeated mounts never accumulate fields', async () => {\n const input = new Input({});\n const el = holderFor(input);\n\n await input.componentDidMount();\n await input.componentDidMount();\n await input.componentDidMount();\n\n expect(fieldCount(el)).toBe(1);\n });\n\n // MathLive's mathModeSpace defaults to '', which makes the spacebar a no-op.\n it('configures the spacebar so a space can be typed', async () => {\n const input = new Input({});\n\n holderFor(input);\n await input.componentDidMount();\n\n // a LaTeX control space - what MathQuill produced, and MathJax understands\n expect(input.mathField.mathModeSpace).toEqual('\\\\ ');\n expect(input.mathField.mathModeSpace).not.toEqual('');\n });\n\n it('reports itself through innerRef on mount and clears it on unmount', async () => {\n const innerRef = jest.fn();\n const input = new Input({ innerRef });\n\n holderFor(input);\n await input.componentDidMount();\n\n expect(innerRef).toHaveBeenCalledWith(input);\n\n input.componentWillUnmount();\n\n expect(innerRef).toHaveBeenLastCalledWith(null);\n });\n});\n"],"mappings":";;;;;;;AAyCA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAC,IAAI,CAACC,IAAI,CAAC,sBAAsB,EAAE,YAAM;EACtC;EACA;EACA;EAAA,IACMC,oBAAoB,oBAAAC,aAAA,aACxB,SAAAD,qBAAA,EAAc;IAAA,IAAAE,gBAAA,mBAAAF,oBAAA;IACZ;IACA;IACA,IAAMG,EAAE,GAAGC,MAAM,CAACC,QAAQ,CAACC,aAAa,CAAC,YAAY,CAAC;IAEtDH,EAAE,CAACI,KAAK,GAAG,EAAE;IACbJ,EAAE,CAACK,QAAQ,GAAG;MAAA,OAAML,EAAE,CAACI,KAAK;IAAA;IAE5B,OAAOJ,EAAE;EACX,CAAC;EAGH,OAAO;IACLM,YAAY,EAAE,SAAdA,YAAYA,CAAA;MAAA,OAAQC,OAAO,CAACC,OAAO,CAAC;QAAEC,gBAAgB,EAAEZ;MAAqB,CAAC,CAAC;IAAA;IAC/Ea,SAAS,EAAE,SAAXA,SAASA,CAAA;MAAA,OAAS,CAAC,CAAC;IAAA,CAAC;IACrB;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