@digabi/exam-engine-core 22.1.4-alpha.0 → 22.1.6-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/__tests__/EditableGradingInstruction.test.d.ts +1 -1
- package/dist/__tests__/EditableGradingInstruction.test.d.ts.map +1 -1
- package/dist/__tests__/EditableGradingInstruction.test.js +10 -3
- package/dist/__tests__/EditableGradingInstruction.test.js.map +1 -1
- package/dist/__tests__/editor/FormatButton.test.js +21 -20
- package/dist/__tests__/editor/FormatButton.test.js.map +1 -1
- package/dist/__tests__/editor/Formula.test.js +1 -1
- package/dist/__tests__/editor/Formula.test.js.map +1 -1
- package/dist/__tests__/editor/ImageUploadButton.test.js +1 -1
- package/dist/__tests__/editor/ImageUploadButton.test.js.map +1 -1
- package/dist/__tests__/editor/nbsp.test.js +1 -1
- package/dist/__tests__/editor/nbsp.test.js.map +1 -1
- package/dist/__tests__/editor/noWrap.test.js +1 -1
- package/dist/__tests__/editor/noWrap.test.js.map +1 -1
- package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
- package/dist/components/grading-instructions/EditableGradingInstruction.d.ts.map +1 -1
- package/dist/components/grading-instructions/EditableGradingInstruction.js +55 -23
- package/dist/components/grading-instructions/EditableGradingInstruction.js.map +1 -1
- package/dist/components/grading-instructions/ExamGradingInstruction.d.ts.map +1 -1
- package/dist/components/grading-instructions/ExamGradingInstruction.js +2 -7
- package/dist/components/grading-instructions/ExamGradingInstruction.js.map +1 -1
- package/dist/components/grading-instructions/editor/FormatButton.d.ts +3 -2
- package/dist/components/grading-instructions/editor/FormatButton.d.ts.map +1 -1
- package/dist/components/grading-instructions/editor/FormatButton.js +5 -2
- package/dist/components/grading-instructions/editor/FormatButton.js.map +1 -1
- package/dist/components/grading-instructions/editor/Formula.d.ts.map +1 -1
- package/dist/components/grading-instructions/editor/Formula.js +1 -0
- package/dist/components/grading-instructions/editor/Formula.js.map +1 -1
- package/dist/components/grading-instructions/editor/ImageUploadButton.d.ts.map +1 -1
- package/dist/components/grading-instructions/editor/ImageUploadButton.js +6 -2
- package/dist/components/grading-instructions/editor/ImageUploadButton.js.map +1 -1
- package/dist/components/grading-instructions/editor/NBSP.d.ts.map +1 -1
- package/dist/components/grading-instructions/editor/NBSP.js +1 -1
- package/dist/components/grading-instructions/editor/NBSP.js.map +1 -1
- package/dist/components/grading-instructions/editor/Table.d.ts +4 -1
- package/dist/components/grading-instructions/editor/Table.d.ts.map +1 -1
- package/dist/components/grading-instructions/editor/Table.js +82 -28
- package/dist/components/grading-instructions/editor/Table.js.map +1 -1
- package/dist/main-bundle.js +1 -1
- package/dist/main.css +1 -1
- package/package.json +2 -2
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
import '@testing-library/jest-dom';
|
2
2
|
//# sourceMappingURL=EditableGradingInstruction.test.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EditableGradingInstruction.test.d.ts","sourceRoot":"","sources":["../../__tests__/EditableGradingInstruction.test.tsx"],"names":[],"mappings":""}
|
1
|
+
{"version":3,"file":"EditableGradingInstruction.test.d.ts","sourceRoot":"","sources":["../../__tests__/EditableGradingInstruction.test.tsx"],"names":[],"mappings":"AAIA,OAAO,2BAA2B,CAAA"}
|
@@ -7,6 +7,7 @@ const react_1 = require("@testing-library/react");
|
|
7
7
|
const user_event_1 = __importDefault(require("@testing-library/user-event"));
|
8
8
|
const renderEditableGradingInstruction_1 = require("./utils/renderEditableGradingInstruction");
|
9
9
|
const util_1 = require("./utils/util");
|
10
|
+
require("@testing-library/jest-dom");
|
10
11
|
const act = react_1.act;
|
11
12
|
describe('EditableGradingInstruction', () => {
|
12
13
|
let cleanup;
|
@@ -44,7 +45,7 @@ describe('EditableGradingInstruction', () => {
|
|
44
45
|
const expectedOutput = '<table class="e-table e-width-half"><tbody><tr><td></td><td></td></tr><tr><td></td><td></td></tr></tbody></table>';
|
45
46
|
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
46
47
|
await act(async () => {
|
47
|
-
await user_event_1.default.click(await result.
|
48
|
+
await user_event_1.default.click(await result.findByTestId('editor-menu-add-table'));
|
48
49
|
});
|
49
50
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
50
51
|
});
|
@@ -87,6 +88,7 @@ describe('EditableGradingInstruction', () => {
|
|
87
88
|
const inputData = '<table class="e-width-half"><tbody><tr><td>foo</td></tr></tbody></table>';
|
88
89
|
const expectedOutput = '<table class="e-width-full"><tbody><tr><td>foo</td></tr></tbody></table>';
|
89
90
|
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
91
|
+
expect(result.queryByText('Puolikas leveys')).not.toBeInTheDocument();
|
90
92
|
await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Täysi leveys');
|
91
93
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
92
94
|
});
|
@@ -94,6 +96,7 @@ describe('EditableGradingInstruction', () => {
|
|
94
96
|
const inputData = '<table class="e-width-full"><tbody><tr><td>foo</td></tr></tbody></table>';
|
95
97
|
const expectedOutput = '<table class="e-width-half"><tbody><tr><td>foo</td></tr></tbody></table>';
|
96
98
|
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
99
|
+
expect(result.queryByText('Täysi leveys')).not.toBeInTheDocument();
|
97
100
|
await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Puolikas leveys');
|
98
101
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
99
102
|
});
|
@@ -101,6 +104,7 @@ describe('EditableGradingInstruction', () => {
|
|
101
104
|
const inputData = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
|
102
105
|
const expectedOutput = '<table class="e-table--borderless"><tbody><tr><td>foo</td></tr></tbody></table>';
|
103
106
|
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
107
|
+
expect(result.queryByText('Lisää reunat')).not.toBeInTheDocument();
|
104
108
|
await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Poista reunat');
|
105
109
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
106
110
|
});
|
@@ -108,6 +112,7 @@ describe('EditableGradingInstruction', () => {
|
|
108
112
|
const inputData = '<table class="e-table--borderless"><tbody><tr><td>foo</td></tr></tbody></table>';
|
109
113
|
const expectedOutput = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
|
110
114
|
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
115
|
+
expect(result.queryByText('Poista reunat')).not.toBeInTheDocument();
|
111
116
|
await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Lisää reunat');
|
112
117
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
113
118
|
});
|
@@ -115,14 +120,16 @@ describe('EditableGradingInstruction', () => {
|
|
115
120
|
const inputData = '<table class="e-table--zebra"><tbody><tr><td>foo</td></tr></tbody></table>';
|
116
121
|
const expectedOutput = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
|
117
122
|
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
118
|
-
|
123
|
+
expect(result.queryByText('Lisää raidat')).not.toBeInTheDocument();
|
124
|
+
await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Poista raidat');
|
119
125
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
120
126
|
});
|
121
127
|
it('Add zebra adds e-table--zebra class to table', async () => {
|
122
128
|
const inputData = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
|
123
129
|
const expectedOutput = '<table class="e-table--zebra"><tbody><tr><td>foo</td></tr></tbody></table>';
|
124
130
|
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
125
|
-
|
131
|
+
expect(result.queryByText('Poista raidat')).not.toBeInTheDocument();
|
132
|
+
await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Lisää raidat');
|
126
133
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
127
134
|
});
|
128
135
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EditableGradingInstruction.test.js","sourceRoot":"","sources":["../../__tests__/EditableGradingInstruction.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAqE;AACrE,6EAAmD;AACnD,+FAAmF;AACnF,uCAAyC;
|
1
|
+
{"version":3,"file":"EditableGradingInstruction.test.js","sourceRoot":"","sources":["../../__tests__/EditableGradingInstruction.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAqE;AACrE,6EAAmD;AACnD,+FAAmF;AACnF,uCAAyC;AACzC,qCAAkC;AAElC,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,IAAI,OAA4B,CAAA;IAChC,IAAI,mBAA8B,CAAA;IAElC,UAAU,CAAC,GAAG,EAAE;QACd,mBAAmB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IACjC,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,EAAE,CAAA;QACX,CAAC;QACD,OAAO,GAAG,IAAI,CAAA;IAChB,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;QACrB,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;YACvC,MAAM,SAAS,GAAG,qEAAqE,CAAA;YACvF,MAAM,cAAc,GAAG,qEAAqE,CAAA;YAC5F,MAAM,MAAM,GAAG,IAAA,2DAAwB,EAAC,SAAS,CAAC,CAAA;YAClD,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;YAC5D,MAAM,CAAC,KAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;QAC/C,CA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BAAmB,CAAC,CAAA;AACzE,CAAC"}
|
@@ -11,6 +11,7 @@ const prosemirror_1 = require("../utils/prosemirror");
|
|
11
11
|
const FormatButton_1 = __importDefault(require("../../src/components/grading-instructions/editor/FormatButton"));
|
12
12
|
const user_event_1 = __importDefault(require("@testing-library/user-event"));
|
13
13
|
const util_1 = require("../utils/util");
|
14
|
+
const free_solid_svg_icons_1 = require("@fortawesome/free-solid-svg-icons");
|
14
15
|
const act = react_2.act;
|
15
16
|
describe('FormatButton', () => {
|
16
17
|
beforeAll(() => {
|
@@ -21,54 +22,54 @@ describe('FormatButton', () => {
|
|
21
22
|
});
|
22
23
|
describe('Italics', () => {
|
23
24
|
it('Renders italics button', () => {
|
24
|
-
const props = { markName: 'em',
|
25
|
+
const props = { markName: 'em', icon: free_solid_svg_icons_1.faItalic };
|
25
26
|
const { button } = renderEditorWithFormatButton(props);
|
26
|
-
expect(button).
|
27
|
+
expect(button.children[0]).toHaveAttribute('data-icon', 'italic');
|
27
28
|
});
|
28
29
|
it('Toggles button active state when clicked', async () => {
|
29
|
-
const props = { markName: 'em',
|
30
|
+
const props = { markName: 'em', icon: free_solid_svg_icons_1.faItalic };
|
30
31
|
const { button } = renderEditorWithFormatButton(props);
|
31
|
-
expect(button).
|
32
|
+
expect(button).not.toHaveClass('active');
|
32
33
|
await user_event_1.default.click(button);
|
33
|
-
expect(button).
|
34
|
+
expect(button).toHaveClass('active');
|
34
35
|
await user_event_1.default.click(button);
|
35
|
-
expect(button).
|
36
|
+
expect(button).not.toHaveClass('active');
|
36
37
|
});
|
37
38
|
it('formats text', async () => {
|
38
|
-
const props = { markName: 'em',
|
39
|
+
const props = { markName: 'em', icon: free_solid_svg_icons_1.faItalic };
|
39
40
|
const { button, paragraph, container } = renderEditorWithFormatButton(props);
|
40
41
|
await user_event_1.default.click(button);
|
41
42
|
await act(async () => (0, util_1.insertText)(await container.findByRole('paragraph'), 'hello'));
|
42
43
|
expect((0, react_2.within)(paragraph).getByRole('emphasis')).toHaveTextContent('hello');
|
43
44
|
});
|
44
45
|
it('em tags are rendered as italic', () => {
|
45
|
-
const props = { markName: 'em',
|
46
|
+
const props = { markName: 'em', icon: free_solid_svg_icons_1.faItalic, innerHtml: '<em>Italic text</em>' };
|
46
47
|
const { paragraph } = renderEditorWithFormatButton(props);
|
47
48
|
expect((0, react_2.within)(paragraph).getByRole('emphasis')).toHaveTextContent('Italic text');
|
48
49
|
});
|
49
50
|
it('i tags are rendered as italic', () => {
|
50
|
-
const props = { markName: 'em',
|
51
|
+
const props = { markName: 'em', icon: free_solid_svg_icons_1.faItalic, innerHtml: '<i>Italic text</i>' };
|
51
52
|
const { paragraph } = renderEditorWithFormatButton(props);
|
52
53
|
expect((0, react_2.within)(paragraph).getByRole('emphasis')).toHaveTextContent('Italic text');
|
53
54
|
});
|
54
55
|
});
|
55
56
|
describe('Bold', () => {
|
56
57
|
it('Renders bold button', () => {
|
57
|
-
const props = { markName: 'strong',
|
58
|
+
const props = { markName: 'strong', icon: free_solid_svg_icons_1.faBold };
|
58
59
|
const { button } = renderEditorWithFormatButton(props);
|
59
|
-
expect(button).
|
60
|
+
expect(button.children[0]).toHaveAttribute('data-icon', 'bold');
|
60
61
|
});
|
61
62
|
it('Toggles button active state when clicked', async () => {
|
62
|
-
const props = { markName: 'strong',
|
63
|
+
const props = { markName: 'strong', icon: free_solid_svg_icons_1.faBold };
|
63
64
|
const { button } = renderEditorWithFormatButton(props);
|
64
|
-
expect(button).
|
65
|
+
expect(button).not.toHaveClass('active');
|
65
66
|
await user_event_1.default.click(button);
|
66
|
-
expect(button).
|
67
|
+
expect(button).toHaveClass('active');
|
67
68
|
await user_event_1.default.click(button);
|
68
|
-
expect(button).
|
69
|
+
expect(button).not.toHaveClass('active');
|
69
70
|
});
|
70
71
|
it('formats text', async () => {
|
71
|
-
const props = { markName: 'strong',
|
72
|
+
const props = { markName: 'strong', icon: free_solid_svg_icons_1.faBold };
|
72
73
|
const { button, container, paragraph } = renderEditorWithFormatButton(props);
|
73
74
|
await user_event_1.default.click(button);
|
74
75
|
await act(async () => {
|
@@ -77,20 +78,20 @@ describe('FormatButton', () => {
|
|
77
78
|
expect((0, react_2.within)(paragraph).getByRole('strong')).toHaveTextContent('hello');
|
78
79
|
});
|
79
80
|
it('b tags are rendered as bold', () => {
|
80
|
-
const props = { markName: 'strong',
|
81
|
+
const props = { markName: 'strong', icon: free_solid_svg_icons_1.faBold, innerHtml: '<b>Bold text</b>' };
|
81
82
|
const { paragraph } = renderEditorWithFormatButton(props);
|
82
83
|
expect((0, react_2.within)(paragraph).getByRole('strong')).toHaveTextContent('Bold text');
|
83
84
|
});
|
84
85
|
it('strong tags are rendered as bold', () => {
|
85
|
-
const props = { markName: 'strong',
|
86
|
+
const props = { markName: 'strong', icon: free_solid_svg_icons_1.faBold, innerHtml: '<strong>Bold text</strong>' };
|
86
87
|
const { paragraph } = renderEditorWithFormatButton(props);
|
87
88
|
expect((0, react_2.within)(paragraph).getByRole('strong')).toHaveTextContent('Bold text');
|
88
89
|
});
|
89
90
|
});
|
90
91
|
function renderEditorWithFormatButton(props) {
|
91
|
-
const { markName,
|
92
|
+
const { markName, icon, innerHtml = '' } = props;
|
92
93
|
const container = (0, react_2.render)(react_1.default.createElement(ProseMirrorWrapper_1.default, { innerHtml: innerHtml },
|
93
|
-
react_1.default.createElement(FormatButton_1.default, { markName: markName,
|
94
|
+
react_1.default.createElement(FormatButton_1.default, { markName: markName, icon: icon })));
|
94
95
|
return { button: container.getByRole('button'), paragraph: container.getByRole('paragraph'), container };
|
95
96
|
}
|
96
97
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FormatButton.test.js","sourceRoot":"","sources":["../../../__tests__/editor/FormatButton.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,qCAAkC;AAClC,kDAAgF;AAChF,qFAA4D;AAC5D,sDAAsD;AACtD,iHAAwF;AACxF,6EAAmD;AACnD,wCAA0C;AAE1C,MAAM,GAAG,GAAG,WA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MAAM,CAAC,IAAA,cAAM,EAAC,SAAS,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAA;QAC9E,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;YAC1C,MAAM,KAAK,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,6BAAM,EAAE,SAAS,EAAE,4BAA4B,EAAE,CAAA;YAC3F,MAAM,EAAE,SAAS,EAAE,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAA;YACzD,MAAM,CAAC,IAAA,cAAM,EAAC,SAAS,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAA;QAC9E,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,SAAS,4BAA4B,CAAC,KAAqE;QACzG,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,KAAK,CAAA;QAChD,MAAM,SAAS,GAAG,IAAA,cAAM,EACtB,8BAAC,4BAAkB,IAAC,SAAS,EAAE,SAAS;YACtC,8BAAC,sBAAY,IAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAI,CAC7B,CACtB,CAAA;QACD,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,CAAA;IAC1G,CAAC;AACH,CAAC,CAAC,CAAA"}
|
@@ -19,7 +19,7 @@ describe('Editor - Formula', () => {
|
|
19
19
|
});
|
20
20
|
it('Formula is rendered as expected', () => {
|
21
21
|
const inputData = '<p>bar <e:formula data-editor-id="e-formula">foo</e:formula></p>';
|
22
|
-
const expectedOutput = '<p>bar <img alt="foo" src="/math.svg?latex=foo"><img class="ProseMirror-separator" alt=""><br class="ProseMirror-trailingBreak"></p>';
|
22
|
+
const expectedOutput = '<p>bar <img alt="foo" formula="true" src="/math.svg?latex=foo"><img class="ProseMirror-separator" alt=""><br class="ProseMirror-trailingBreak"></p>';
|
23
23
|
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData);
|
24
24
|
const table = result.container.querySelector('.ProseMirror');
|
25
25
|
expect(table.innerHTML).toBe(expectedOutput);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Formula.test.js","sourceRoot":"","sources":["../../../__tests__/editor/Formula.test.tsx"],"names":[],"mappings":";;AAAA,kDAAuD;AACvD,sDAAsD;AACtD,gGAAoF;AACpF,wCAA0C;AAE1C,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,IAAI,OAA4B,CAAA;IAChC,IAAI,mBAA8B,CAAA;IAElC,UAAU,CAAC,GAAG,EAAE;QACd,mBAAmB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IACjC,CAAC,CAAC,CAAA;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,EAAE,CAAA;QACX,CAAC;QACD,OAAO,GAAG,IAAI,CAAA;IAChB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,SAAS,GAAG,kEAAkE,CAAA;QACpF,MAAM,cAAc,GAClB,
|
1
|
+
{"version":3,"file":"Formula.test.js","sourceRoot":"","sources":["../../../__tests__/editor/Formula.test.tsx"],"names":[],"mappings":";;AAAA,kDAAuD;AACvD,sDAAsD;AACtD,gGAAoF;AACpF,wCAA0C;AAE1C,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,IAAI,OAA4B,CAAA;IAChC,IAAI,mBAA8B,CAAA;IAElC,UAAU,CAA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EAAE;QACrE,OAAO,GAAG,IAAA,6BAAe,GAAE,CAAA;QAC3B,MAAM,SAAS,GAAG,qEAAqE,CAAA;QACvF,MAAM,cAAc,GAAG,mBAAmB,CAAA;QAC1C,MAAM,MAAM,GAAG,IAAA,2DAAwB,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAA;QACvE,MAAM,GAAG,CAAC,KAAK,IAAI,EAAE;YACnB,IAAA,iBAAU,EAAC,MAAM,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAA;QACnD,CAAC,CAAC,CAAA;QACF,MAAM,CAAC,mBAAmB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QACpD,MAAM,CAAC,mBAAmB,CAAC,CAAC,oBAAoB,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;IACtE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
@@ -54,7 +54,7 @@ describe('ImageUploadButton', () => {
|
|
54
54
|
it('image can be uploaded', async () => {
|
55
55
|
const container = (0, renderEditableGradingInstruction_1.renderGradingInstruction)('', onContentChangeMock);
|
56
56
|
const file = new File(['hello'], 'hello.png', { type: 'image/png' });
|
57
|
-
const input = container.queryByTestId('image-upload-
|
57
|
+
const input = container.queryByTestId('image-upload-input');
|
58
58
|
await user_event_1.default.upload(input, file);
|
59
59
|
await (0, react_1.waitFor)(() => {
|
60
60
|
expect(onContentChangeMock).toHaveBeenCalledTimes(2);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ImageUploadButton.test.js","sourceRoot":"","sources":["../../../__tests__/editor/ImageUploadButton.test.tsx"],"names":[],"mappings":";;;;;AAAA,qCAAkC;AAClC,kDAAyE;AACzE,sDAAsD;AACtD,gGAIkD;AAClD,6EAAmD;AACnD,wCAA0C;AAC1C,uDAA6C;AAE7C,IAAI,CAAC,KAAK,CAAC,6BAAU,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,kBAAkB,CAAC,GAA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C,GAAG,EAAE;gBACjB,MAAM,CAAC,mBAAmB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;gBACpD,MAAM,CAAC,mBAAmB,CAAC,CAAC,uBAAuB,CAAC,CAAC,EAAE,oBAAoB,aAAa,kBAAkB,EAAE,EAAE,CAAC,CAAA;gBAC/G,MAAM,CAAC,mBAAmB,CAAC,CAAC,uBAAuB,CACjD,CAAC,EACD,oBAAoB,qDAAkB,kBAAkB,EACxD,EAAE,CACH,CAAA;gBACD,MAAM,KAAK,GAAG,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;gBACxC,MAAM,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,qDAAkB,IAAI,qDAAkB,EAAE,CAAC,CAAA;YACtF,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
@@ -48,7 +48,7 @@ describe('Editor - NBSP', () => {
|
|
48
48
|
await act(async () => {
|
49
49
|
await user_event_1.default.click(await result.findByText('NBSP'));
|
50
50
|
});
|
51
|
-
expect(onContentChangeMock).toHaveBeenCalledTimes(
|
51
|
+
expect(onContentChangeMock).toHaveBeenCalledTimes(1);
|
52
52
|
expect(onContentChangeMock).toHaveBeenLastCalledWith(expectedOutput, '');
|
53
53
|
});
|
54
54
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nbsp.test.js","sourceRoot":"","sources":["../../../__tests__/editor/nbsp.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAuD;AACvD,sDAAsD;AACtD,gGAAoF;AACpF,6EAAmD;AACnD,wCAA0C;AAE1C,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,IAAI,OAA4B,CAAA;IAChC,IAAI,mBAA8B,CAAA;IAElC,UAAU,CAAC,GAAG,EAAE;QACd,mBAAmB,G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MAAM,CAAC,mBAAmB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QACpD,MAAM,CAAC,mBAAmB,CAAC,CAAC,wBAAwB,CAAC,cAAc,EAAE,EAAE,CAAC,CAAA;IAC1E,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
@@ -31,7 +31,7 @@ describe('Editor - e-nowrap', () => {
|
|
31
31
|
});
|
32
32
|
it('e:formula is rendered as expected when wrapped inside e-nowrap', async () => {
|
33
33
|
const inputData = '<p>bar</p><span class="e-nowrap"><e:formula data-editor-id=e-formula>foo</e:formula></span>';
|
34
|
-
const expectedDom = '<p>foo</p><p><span class="e-nowrap"><img alt="foo" src="/math.svg?latex=foo"><img class="ProseMirror-separator" alt=""></span><br class="ProseMirror-trailingBreak"></p>';
|
34
|
+
const expectedDom = '<p>foo</p><p><span class="e-nowrap"><img alt="foo" formula="true" src="/math.svg?latex=foo"><img class="ProseMirror-separator" alt=""></span><br class="ProseMirror-trailingBreak"></p>';
|
35
35
|
const expectedOutput = '<p>foo</p><p><span class="e-nowrap"><e:formula>foo</e:formula></span></p>';
|
36
36
|
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
37
37
|
await act(async () => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"noWrap.test.js","sourceRoot":"","sources":["../../../__tests__/editor/noWrap.test.tsx"],"names":[],"mappings":";;AAAA,kDAAkE;AAClE,sDAAsD;AACtD,gGAAoF;AAEpF,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAI,OAA4B,CAAA;IAChC,IAAI,mBAA8B,CAAA;IAElC,UAAU,CAAC,GAAG,EAAE;QACd,mBAAmB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;QAC/B,OAAO,GAAG,IAAA,6BAAe,GAAE,CAAA;IAC7B,CAAC,CAAC,CAAA;IAEF,SAAS,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