@digabi/exam-engine-core 22.0.1-alpha.7 → 22.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/__tests__/EditableGradingInsatruction.test.d.ts +1 -0
- package/dist/__tests__/EditableGradingInsatruction.test.d.ts.map +1 -0
- package/dist/__tests__/EditableGradingInsatruction.test.js +2 -0
- package/dist/__tests__/EditableGradingInsatruction.test.js.map +1 -0
- package/dist/__tests__/EditableGradingInstruction.test.js +44 -51
- package/dist/__tests__/EditableGradingInstruction.test.js.map +1 -1
- package/dist/__tests__/editor/Formula.test.d.ts +2 -0
- package/dist/__tests__/editor/Formula.test.d.ts.map +1 -0
- package/dist/__tests__/editor/Formula.test.js +43 -0
- package/dist/__tests__/editor/Formula.test.js.map +1 -0
- package/dist/__tests__/editor/NBSP.test.d.ts +2 -0
- package/dist/__tests__/editor/NBSP.test.d.ts.map +1 -0
- package/dist/__tests__/editor/NBSP.test.js +59 -0
- package/dist/__tests__/editor/NBSP.test.js.map +1 -0
- package/dist/__tests__/editor/br.test.d.ts +2 -0
- package/dist/__tests__/editor/br.test.d.ts.map +1 -0
- package/dist/__tests__/editor/br.test.js +43 -0
- package/dist/__tests__/editor/br.test.js.map +1 -0
- package/dist/__tests__/editor/hr.test.d.ts +2 -0
- package/dist/__tests__/editor/hr.test.d.ts.map +1 -0
- package/dist/__tests__/editor/hr.test.js +43 -0
- package/dist/__tests__/editor/hr.test.js.map +1 -0
- package/dist/__tests__/editor/no-wrap.test.d.ts +2 -0
- package/dist/__tests__/editor/no-wrap.test.d.ts.map +1 -0
- package/dist/__tests__/editor/no-wrap.test.js +43 -0
- package/dist/__tests__/editor/no-wrap.test.js.map +1 -0
- package/dist/__tests__/editor/noWrap.test.d.ts +2 -0
- package/dist/__tests__/editor/noWrap.test.d.ts.map +1 -0
- package/dist/__tests__/editor/noWrap.test.js +62 -0
- package/dist/__tests__/editor/noWrap.test.js.map +1 -0
- package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
- package/dist/__tests__/utils/EditableGradingInstructionsWrapper.d.ts +1 -0
- package/dist/__tests__/utils/EditableGradingInstructionsWrapper.d.ts.map +1 -0
- package/dist/__tests__/utils/EditableGradingInstructionsWrapper.js +2 -0
- package/dist/__tests__/utils/EditableGradingInstructionsWrapper.js.map +1 -0
- package/dist/__tests__/utils/renderEditableGradingInstruction.d.ts +2 -0
- package/dist/__tests__/utils/renderEditableGradingInstruction.d.ts.map +1 -0
- package/dist/__tests__/utils/renderEditableGradingInstruction.js +16 -0
- package/dist/__tests__/utils/renderEditableGradingInstruction.js.map +1 -0
- package/dist/__tests__/utils/renderEditableGradingInstructions.d.ts +1 -0
- package/dist/__tests__/utils/renderEditableGradingInstructions.d.ts.map +1 -0
- package/dist/__tests__/utils/renderEditableGradingInstructions.js +2 -0
- package/dist/__tests__/utils/renderEditableGradingInstructions.js.map +1 -0
- package/dist/components/LexicalEditor.d.ts +3 -0
- package/dist/components/LexicalEditor.d.ts.map +1 -0
- package/dist/components/LexicalEditor.js +44 -0
- package/dist/components/LexicalEditor.js.map +1 -0
- package/dist/components/RTE.d.ts +3 -0
- package/dist/components/RTE.d.ts.map +1 -0
- package/dist/components/RTE.js +23 -0
- package/dist/components/RTE.js.map +1 -0
- package/dist/components/TablePlugin.d.ts +1 -0
- package/dist/components/TablePlugin.d.ts.map +1 -0
- package/dist/components/TablePlugin.js +2 -0
- package/dist/components/TablePlugin.js.map +1 -0
- package/dist/components/ToolBarPlugin.d.ts +10 -0
- package/dist/components/ToolBarPlugin.d.ts.map +1 -0
- package/dist/components/ToolBarPlugin.js +111 -0
- package/dist/components/ToolBarPlugin.js.map +1 -0
- package/dist/components/context/AnnotationContext.d.ts +8 -0
- package/dist/components/context/AnnotationContext.d.ts.map +1 -0
- package/dist/components/context/AnnotationContext.js +3 -0
- package/dist/components/context/AnnotationContext.js.map +1 -0
- package/dist/components/context/CommonExamContext.d.ts +0 -1
- package/dist/components/context/CommonExamContext.d.ts.map +1 -1
- package/dist/components/context/CommonExamContext.js +0 -3
- package/dist/components/context/CommonExamContext.js.map +1 -1
- package/dist/components/exam/ExamineExam.d.ts +5 -0
- package/dist/components/exam/ExamineExam.d.ts.map +1 -0
- package/dist/components/exam/ExamineExam.js +20 -0
- package/dist/components/exam/ExamineExam.js.map +1 -0
- package/dist/components/exam/FinishExam.d.ts +5 -0
- package/dist/components/exam/FinishExam.d.ts.map +1 -0
- package/dist/components/exam/FinishExam.js +17 -0
- package/dist/components/exam/FinishExam.js.map +1 -0
- package/dist/components/grading/reactAnnotation.d.ts +4 -0
- package/dist/components/grading/reactAnnotation.d.ts.map +1 -0
- package/dist/components/grading/reactAnnotation.js +54 -0
- package/dist/components/grading/reactAnnotation.js.map +1 -0
- package/dist/components/grading-instructions/AnswerGradingInstruction.d.ts.map +1 -1
- package/dist/components/grading-instructions/AnswerGradingInstruction.js +2 -7
- package/dist/components/grading-instructions/AnswerGradingInstruction.js.map +1 -1
- package/dist/components/grading-instructions/EditableGradingInstruction.d.ts.map +1 -1
- package/dist/components/grading-instructions/EditableGradingInstruction.js +56 -12
- 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/GradingInstructions.d.ts +1 -2
- package/dist/components/grading-instructions/GradingInstructions.d.ts.map +1 -1
- package/dist/components/grading-instructions/GradingInstructions.js +15 -18
- package/dist/components/grading-instructions/GradingInstructions.js.map +1 -1
- package/dist/components/grading-instructions/SlateTableEditor.d.ts +22 -0
- package/dist/components/grading-instructions/SlateTableEditor.d.ts.map +1 -0
- package/dist/components/grading-instructions/SlateTableEditor.js +44 -0
- package/dist/components/grading-instructions/SlateTableEditor.js.map +1 -0
- package/dist/components/grading-instructions/SlateUtils.d.ts +5 -0
- package/dist/components/grading-instructions/SlateUtils.d.ts.map +1 -0
- package/dist/components/grading-instructions/SlateUtils.js +28 -0
- package/dist/components/grading-instructions/SlateUtils.js.map +1 -0
- package/dist/components/grading-instructions/editor/FormatButton.d.ts +4 -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 +17 -0
- package/dist/components/grading-instructions/editor/Formula.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/Formula.js +81 -0
- package/dist/components/grading-instructions/editor/Formula.js.map +1 -0
- package/dist/components/grading-instructions/editor/FormulaPopup.d.ts +7 -0
- package/dist/components/grading-instructions/editor/FormulaPopup.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/FormulaPopup.js +49 -0
- package/dist/components/grading-instructions/editor/FormulaPopup.js.map +1 -0
- package/dist/components/grading-instructions/editor/MathPopup.d.ts +10 -0
- package/dist/components/grading-instructions/editor/MathPopup.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/MathPopup.js +94 -0
- package/dist/components/grading-instructions/editor/MathPopup.js.map +1 -0
- package/dist/components/grading-instructions/editor/NBSP.d.ts +4 -0
- package/dist/components/grading-instructions/editor/NBSP.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/NBSP.js +17 -0
- package/dist/components/grading-instructions/editor/NBSP.js.map +1 -0
- package/dist/components/grading-instructions/editor/Table.d.ts.map +1 -1
- package/dist/components/grading-instructions/editor/Table.js +24 -5
- package/dist/components/grading-instructions/editor/Table.js.map +1 -1
- package/dist/components/grading-instructions/editor/math-svg.d.ts +2 -0
- package/dist/components/grading-instructions/editor/math-svg.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/math-svg.js +22 -0
- package/dist/components/grading-instructions/editor/math-svg.js.map +1 -0
- package/dist/components/grading-instructions/editor/math.d.ts +4 -0
- package/dist/components/grading-instructions/editor/math.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/math.js +55 -0
- package/dist/components/grading-instructions/editor/math.js.map +1 -0
- package/dist/components/grading-instructions/editor/noWrap.d.ts +3 -0
- package/dist/components/grading-instructions/editor/noWrap.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/noWrap.js +13 -0
- package/dist/components/grading-instructions/editor/noWrap.js.map +1 -0
- package/dist/components/grading-instructions/editor/spanWithClass.d.ts +3 -0
- package/dist/components/grading-instructions/editor/spanWithClass.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/spanWithClass.js +19 -0
- package/dist/components/grading-instructions/editor/spanWithClass.js.map +1 -0
- package/dist/components/grading-instructions/editor/spanWithNowrap.d.ts +3 -0
- package/dist/components/grading-instructions/editor/spanWithNowrap.d.ts.map +1 -0
- package/dist/components/grading-instructions/editor/spanWithNowrap.js +19 -0
- package/dist/components/grading-instructions/editor/spanWithNowrap.js.map +1 -0
- package/dist/components/grading-instructions/prosemirror.d.ts +8 -0
- package/dist/components/grading-instructions/prosemirror.d.ts.map +1 -0
- package/dist/components/grading-instructions/prosemirror.js +108 -0
- package/dist/components/grading-instructions/prosemirror.js.map +1 -0
- package/dist/components/results/isExamFinishPageHook.d.ts +2 -0
- package/dist/components/results/isExamFinishPageHook.d.ts.map +1 -0
- package/dist/components/results/isExamFinishPageHook.js +7 -0
- package/dist/components/results/isExamFinishPageHook.js.map +1 -0
- package/dist/components/shared/CreateAnnotationPopup.d.ts +6 -0
- package/dist/components/shared/CreateAnnotationPopup.d.ts.map +1 -0
- package/dist/components/shared/CreateAnnotationPopup.js +11 -0
- package/dist/components/shared/CreateAnnotationPopup.js.map +1 -0
- package/dist/components/shared/Popup.d.ts +15 -0
- package/dist/components/shared/Popup.d.ts.map +1 -0
- package/dist/components/shared/Popup.js +90 -0
- package/dist/components/shared/Popup.js.map +1 -0
- package/dist/components/shared/PopupUtils.d.ts +4 -0
- package/dist/components/shared/PopupUtils.d.ts.map +1 -0
- package/dist/components/shared/PopupUtils.js +26 -0
- package/dist/components/shared/PopupUtils.js.map +1 -0
- package/dist/dom-utils.d.ts.map +1 -1
- package/dist/dom-utils.js +4 -2
- package/dist/dom-utils.js.map +1 -1
- package/dist/main-bundle.js +1 -1
- package/dist/main-bundle.js.LICENSE.txt +1 -1
- package/dist/main.css +1 -1
- package/dist/store/listenerMiddleware.d.ts +89 -0
- package/dist/store/listenerMiddleware.d.ts.map +1 -0
- package/dist/store/listenerMiddleware.js +6 -0
- package/dist/store/listenerMiddleware.js.map +1 -0
- package/package.json +3 -10
@@ -0,0 +1 @@
|
|
1
|
+
//# sourceMappingURL=EditableGradingInsatruction.test.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"EditableGradingInsatruction.test.d.ts","sourceRoot":"","sources":["../../__tests__/EditableGradingInsatruction.test.tsx"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"EditableGradingInsatruction.test.js","sourceRoot":"","sources":["../../__tests__/EditableGradingInsatruction.test.tsx"],"names":[],"mappings":""}
|
@@ -3,12 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const react_1 =
|
7
|
-
const react_2 = require("@testing-library/react");
|
8
|
-
const EditableGradingInstruction_1 = __importDefault(require("../src/components/grading-instructions/EditableGradingInstruction"));
|
9
|
-
const GradingInstructionProvider_1 = require("../src/components/grading-instructions/GradingInstructionProvider");
|
6
|
+
const react_1 = require("@testing-library/react");
|
10
7
|
const user_event_1 = __importDefault(require("@testing-library/user-event"));
|
11
|
-
const
|
8
|
+
const renderEditableGradingInstruction_1 = require("./utils/renderEditableGradingInstruction");
|
9
|
+
const act = react_1.act;
|
12
10
|
describe('EditableGradingInstruction', () => {
|
13
11
|
let cleanup;
|
14
12
|
let onContentChangeMock;
|
@@ -23,17 +21,17 @@ describe('EditableGradingInstruction', () => {
|
|
23
21
|
});
|
24
22
|
describe('table', () => {
|
25
23
|
it('Table is rendered as expected', () => {
|
26
|
-
const inputData = '<table class="e-table"><tr><td>foo</td></tr></table>';
|
27
|
-
const expectedOutput = '<table class="e-table"><tbody><tr><td
|
28
|
-
const result =
|
24
|
+
const inputData = '<table class="e-table"><tbody><tr><td>foo</td></tr></tbody></table>';
|
25
|
+
const expectedOutput = '<table class="e-table"><tbody><tr><td>foo</td></tr></tbody></table>';
|
26
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData);
|
29
27
|
const table = result.container.querySelector('.ProseMirror');
|
30
28
|
expect(table.innerHTML).toBe(expectedOutput);
|
31
29
|
});
|
32
30
|
it('Change in table is returned as expected', async () => {
|
33
31
|
cleanup = mockCreateRange();
|
34
|
-
const inputData = '<table class="e-table"><tr><td>foo</td></tr></table>';
|
35
|
-
const expectedOutput = '<table class="e-table"><tbody><tr><td
|
36
|
-
const result =
|
32
|
+
const inputData = '<table class="e-table"><tbody><tr><td>foo</td></tr></tbody></table>';
|
33
|
+
const expectedOutput = '<table class="e-table"><tbody><tr><td>bar</td></tr></tbody></table>';
|
34
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
37
35
|
await act(async () => {
|
38
36
|
insertText(await result.findByText('foo'), 'bar');
|
39
37
|
});
|
@@ -42,87 +40,87 @@ describe('EditableGradingInstruction', () => {
|
|
42
40
|
});
|
43
41
|
it('Insert table adds expected table', async () => {
|
44
42
|
const inputData = '';
|
45
|
-
const expectedOutput = '<table class="e-table e-width-half"><tbody><tr><td
|
46
|
-
const result =
|
43
|
+
const expectedOutput = '<table class="e-table e-width-half"><tbody><tr><td></td><td></td></tr><tr><td></td><td></td></tr></tbody></table>';
|
44
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
47
45
|
await act(async () => {
|
48
46
|
await user_event_1.default.click(await result.findByText('Lisää taulukko'));
|
49
47
|
});
|
50
48
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
51
49
|
});
|
52
50
|
it('Remove table removes table', async () => {
|
53
|
-
const inputData = '<table><tr><td>foo</td></tr></table>';
|
51
|
+
const inputData = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
|
54
52
|
const expectedOutput = '<p></p>';
|
55
|
-
const result =
|
53
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
56
54
|
await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Poista taulukko');
|
57
55
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
58
56
|
});
|
59
57
|
it('Insert column adds column', async () => {
|
60
|
-
const inputData = '<table><tr><td>foo</td></tr></table>';
|
61
|
-
const expectedOutput = '<table><tbody><tr><td
|
62
|
-
const result =
|
58
|
+
const inputData = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
|
59
|
+
const expectedOutput = '<table><tbody><tr><td>foo</td><td></td></tr></tbody></table>';
|
60
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
63
61
|
await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Lisää sarake');
|
64
62
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
65
63
|
});
|
66
64
|
it('Remove column removes column', async () => {
|
67
|
-
const inputData = '<table><tr><td>foo</td><td>bar</td></tr></table>';
|
68
|
-
const expectedOutput = '<table><tbody><tr><td
|
69
|
-
const result =
|
65
|
+
const inputData = '<table><tbody><tr><td>foo</td><td>bar</td></tr></tbody></table>';
|
66
|
+
const expectedOutput = '<table><tbody><tr><td>bar</td></tr></tbody></table>';
|
67
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
70
68
|
await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Poista sarake');
|
71
69
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
72
70
|
});
|
73
71
|
it('Insert row adds row', async () => {
|
74
|
-
const inputData = '<table><tr><td>foo</td></tr></table>';
|
75
|
-
const expectedOutput = '<table><tbody><tr><td
|
76
|
-
const result =
|
72
|
+
const inputData = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
|
73
|
+
const expectedOutput = '<table><tbody><tr><td>foo</td></tr><tr><td></td></tr></tbody></table>';
|
74
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
77
75
|
await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Lisää rivi');
|
78
76
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
79
77
|
});
|
80
78
|
it('Remove row removes row', async () => {
|
81
|
-
const inputData = '<table><tr><td>foo</td></tr><tr><td>bar</td></tr></table>';
|
82
|
-
const expectedOutput = '<table><tbody><tr><td
|
83
|
-
const result =
|
79
|
+
const inputData = '<table><tbody><tr><td>foo</td></tr><tr><td>bar</td></tr></tbody></table>';
|
80
|
+
const expectedOutput = '<table><tbody><tr><td>bar</td></tr></tbody></table>';
|
81
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
84
82
|
await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Poista rivi');
|
85
83
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
86
84
|
});
|
87
85
|
it('Full width changes full width class to table', async () => {
|
88
|
-
const inputData = '<table class="e-width-half"><tr><td>foo</td></tr></table>';
|
89
|
-
const expectedOutput = '<table class="e-width-full"><tbody><tr><td
|
90
|
-
const result =
|
86
|
+
const inputData = '<table class="e-width-half"><tbody><tr><td>foo</td></tr></tbody></table>';
|
87
|
+
const expectedOutput = '<table class="e-width-full"><tbody><tr><td>foo</td></tr></tbody></table>';
|
88
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
91
89
|
await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Täysi leveys');
|
92
90
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
93
91
|
});
|
94
92
|
it('Half width changes half width class to table', async () => {
|
95
|
-
const inputData = '<table class="e-width-full"><tr><td>foo</td></tr></table>';
|
96
|
-
const expectedOutput = '<table class="e-width-half"><tbody><tr><td
|
97
|
-
const result =
|
93
|
+
const inputData = '<table class="e-width-full"><tbody><tr><td>foo</td></tr></tbody></table>';
|
94
|
+
const expectedOutput = '<table class="e-width-half"><tbody><tr><td>foo</td></tr></tbody></table>';
|
95
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
98
96
|
await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Puolikas leveys');
|
99
97
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
100
98
|
});
|
101
99
|
it('Remove borders adds e-table--borderless class to table', async () => {
|
102
|
-
const inputData = '<table><tr><td>foo</td></tr></table>';
|
103
|
-
const expectedOutput = '<table class="e-table--borderless"><tbody><tr><td
|
104
|
-
const result =
|
100
|
+
const inputData = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
|
101
|
+
const expectedOutput = '<table class="e-table--borderless"><tbody><tr><td>foo</td></tr></tbody></table>';
|
102
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
105
103
|
await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Poista reunat');
|
106
104
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
107
105
|
});
|
108
106
|
it('Add borders removes e-table--borderless class from table', async () => {
|
109
|
-
const inputData = '<table class="e-table--borderless"><tr><td>foo</td></tr></table>';
|
110
|
-
const expectedOutput = '<table><tbody><tr><td
|
111
|
-
const result =
|
107
|
+
const inputData = '<table class="e-table--borderless"><tbody><tr><td>foo</td></tr></tbody></table>';
|
108
|
+
const expectedOutput = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
|
109
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
112
110
|
await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Lisää reunat');
|
113
111
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
114
112
|
});
|
115
113
|
it('Remove zebra removes class from table', async () => {
|
116
|
-
const inputData = '<table class="e-table--zebra"><tr><td>foo</td></tr></table>';
|
117
|
-
const expectedOutput = '<table><tbody><tr><td
|
118
|
-
const result =
|
114
|
+
const inputData = '<table class="e-table--zebra"><tbody><tr><td>foo</td></tr></tbody></table>';
|
115
|
+
const expectedOutput = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
|
116
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
119
117
|
await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Poista kuviointi');
|
120
118
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
121
119
|
});
|
122
120
|
it('Add zebra adds e-table--zebra class to table', async () => {
|
123
|
-
const inputData = '<table><tr><td>foo</td></tr></table>';
|
124
|
-
const expectedOutput = '<table class="e-table--zebra"><tbody><tr><td
|
125
|
-
const result =
|
121
|
+
const inputData = '<table><tbody><tr><td>foo</td></tr></tbody></table>';
|
122
|
+
const expectedOutput = '<table class="e-table--zebra"><tbody><tr><td>foo</td></tr></tbody></table>';
|
123
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
126
124
|
await clickTableMenuButtonWithFocusOnCell(result, 'foo', 'Lisää kuviointi');
|
127
125
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
128
126
|
});
|
@@ -140,15 +138,10 @@ async function focusOnTablesCell(result, text) {
|
|
140
138
|
insertText(await result.findByText(text), text);
|
141
139
|
}
|
142
140
|
function insertText(element, text) {
|
143
|
-
|
141
|
+
react_1.fireEvent.input(element, {
|
144
142
|
target: { innerText: text, innerHTML: text }
|
145
143
|
});
|
146
144
|
}
|
147
|
-
function renderGradinginstruction(inputData, onContentChangeMock = () => { }) {
|
148
|
-
const doc = new DOMParser().parseFromString(inputData, 'text/html');
|
149
|
-
return (0, react_2.render)(react_1.default.createElement(GradingInstructionProvider_1.GradingInstructionProvider, { editable: true, onContentChange: onContentChangeMock, saveScreenshot: () => Promise.resolve('') },
|
150
|
-
react_1.default.createElement(EditableGradingInstruction_1.default, { element: doc.documentElement })));
|
151
|
-
}
|
152
145
|
function mockCreateRange() {
|
153
146
|
const originalCreateRange = global.window.document.createRange;
|
154
147
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EditableGradingInstruction.test.js","sourceRoot":"","sources":["../../__tests__/EditableGradingInstruction.test.tsx"],"names":[],"mappings":";;;;;AAAA,
|
1
|
+
{"version":3,"file":"EditableGradingInstruction.test.js","sourceRoot":"","sources":["../../__tests__/EditableGradingInstruction.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAgF;AAChF,6EAAmD;AACnD,+FAAmF;AAEnF,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,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
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const react_1 = require("@testing-library/react");
|
4
|
+
const prosemirror_1 = require("../utils/prosemirror");
|
5
|
+
const renderEditableGradingInstruction_1 = require("../utils/renderEditableGradingInstruction");
|
6
|
+
const act = react_1.act;
|
7
|
+
describe('Editor - Formula', () => {
|
8
|
+
let cleanup;
|
9
|
+
let onContentChangeMock;
|
10
|
+
beforeEach(() => {
|
11
|
+
onContentChangeMock = jest.fn();
|
12
|
+
});
|
13
|
+
afterEach(() => {
|
14
|
+
if (cleanup) {
|
15
|
+
cleanup();
|
16
|
+
}
|
17
|
+
cleanup = null;
|
18
|
+
});
|
19
|
+
it('Formula is rendered as expected', () => {
|
20
|
+
const inputData = '<p>bar <e:formula data-editor-id="e-formula">foo</e:formula></p>';
|
21
|
+
const expectedOutput = '<p>bar <img alt="foo" src="/math.svg?latex=foo"><img class="ProseMirror-separator" alt=""><br class="ProseMirror-trailingBreak"></p>';
|
22
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData);
|
23
|
+
const table = result.container.querySelector('.ProseMirror');
|
24
|
+
expect(table.innerHTML).toBe(expectedOutput);
|
25
|
+
});
|
26
|
+
it('Change in content causes formula to be returned as expected', async () => {
|
27
|
+
cleanup = (0, prosemirror_1.mockCreateRange)();
|
28
|
+
const inputData = '<p>bar</p><p><e:formula data-editor-id="e-formula" mode="inline">foo</e:formula><e:formula data-editor-id="e-formula">bar</e:formula></p>';
|
29
|
+
const expectedOutput = '<p>foo</p><p><e:formula mode="inline">foo</e:formula><e:formula>bar</e:formula></p>';
|
30
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
31
|
+
await act(async () => {
|
32
|
+
insertText(await result.findByText('bar'), 'foo');
|
33
|
+
});
|
34
|
+
expect(onContentChangeMock).toHaveBeenCalledTimes(1);
|
35
|
+
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
36
|
+
});
|
37
|
+
});
|
38
|
+
function insertText(element, text) {
|
39
|
+
react_1.fireEvent.input(element, {
|
40
|
+
target: { innerText: text, innerHTML: text }
|
41
|
+
});
|
42
|
+
}
|
43
|
+
//# sourceMappingURL=Formula.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Formula.test.js","sourceRoot":"","sources":["../../../__tests__/editor/Formula.test.tsx"],"names":[],"mappings":";;AAAA,kDAAkE;AAClE,sDAAsD;AACtD,gGAAoF;AAEpF,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,sIAAsI,CAAA;QACxI,MAAM,MAAM,GAAG,IAAA,2DAAwB,EAAC,SAAS,CAAC,CAAA;QAClD,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;QAC5D,MAAM,CAAC,KAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IAC/C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,6DAA6D,EAAE,KAAK,IAAI,EAAE;QAC3E,OAAO,GAAG,IAAA,6BAAe,GAAE,CAAA;QAC3B,MAAM,SAAS,GACb,2IAA2I,CAAA;QAC7I,MAAM,cAAc,GAAG,qFAAqF,CAAA;QAC5G,MAAM,MAAM,GAAG,IAAA,2DAAwB,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAA;QACvE,MAAM,GAAG,CAAC,KAAK,IAAI,EAAE;YACnB,UAAU,CAAC,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;AAEF,SAAS,UAAU,CAAC,OAAoB,EAAE,IAAY;IACpD,iBAAS,CAAC,KAAK,CAAC,OAAO,EAAE;QACvB,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE;KAC7C,CAAC,CAAA;AACJ,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"nbsp.test.d.ts","sourceRoot":"","sources":["../../../__tests__/editor/nbsp.test.tsx"],"names":[],"mappings":""}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const react_1 = require("@testing-library/react");
|
7
|
+
const prosemirror_1 = require("../utils/prosemirror");
|
8
|
+
const renderEditableGradingInstruction_1 = require("../utils/renderEditableGradingInstruction");
|
9
|
+
const user_event_1 = __importDefault(require("@testing-library/user-event"));
|
10
|
+
const act = react_1.act;
|
11
|
+
describe('Editor - NBSP', () => {
|
12
|
+
let cleanup;
|
13
|
+
let onContentChangeMock;
|
14
|
+
beforeEach(() => {
|
15
|
+
onContentChangeMock = jest.fn();
|
16
|
+
});
|
17
|
+
afterEach(() => {
|
18
|
+
if (cleanup) {
|
19
|
+
cleanup();
|
20
|
+
}
|
21
|
+
cleanup = null;
|
22
|
+
});
|
23
|
+
it('NBSP is rendered as expected', () => {
|
24
|
+
const inputData = '<p> bar</p>';
|
25
|
+
const expectedOutput = '<p><span class="invisible invisible--nb-space ProseMirror-widget"></span> bar</p>';
|
26
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData);
|
27
|
+
const table = result.container.querySelector('.ProseMirror');
|
28
|
+
expect(table.innerHTML).toBe(expectedOutput);
|
29
|
+
});
|
30
|
+
it('Change in content causes NBSP to be returned as expected', async () => {
|
31
|
+
cleanup = (0, prosemirror_1.mockCreateRange)();
|
32
|
+
const inputData = '<p> foo</p><p>bar</p>';
|
33
|
+
const expectedOutput = '<p> foo</p><p>foo</p>';
|
34
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
35
|
+
await act(async () => {
|
36
|
+
insertText(await result.findByText('bar'), 'foo');
|
37
|
+
});
|
38
|
+
expect(onContentChangeMock).toHaveBeenCalledTimes(1);
|
39
|
+
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
40
|
+
});
|
41
|
+
it('Insert NBSP adds expected string', async () => {
|
42
|
+
cleanup = (0, prosemirror_1.mockCreateRange)();
|
43
|
+
const inputData = '<p> foo</p><p>bar</p>';
|
44
|
+
const expectedOutput = '<p>  foo</p><p>bar</p>';
|
45
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
46
|
+
expect(onContentChangeMock).toHaveBeenCalledTimes(0);
|
47
|
+
await act(async () => {
|
48
|
+
await user_event_1.default.click(await result.findByText('NBSP'));
|
49
|
+
});
|
50
|
+
expect(onContentChangeMock).toHaveBeenCalledTimes(2); // focus causes another call
|
51
|
+
expect(onContentChangeMock).toHaveBeenLastCalledWith(expectedOutput, '');
|
52
|
+
});
|
53
|
+
});
|
54
|
+
function insertText(element, text) {
|
55
|
+
react_1.fireEvent.input(element, {
|
56
|
+
target: { innerText: text, innerHTML: text }
|
57
|
+
});
|
58
|
+
}
|
59
|
+
//# sourceMappingURL=nbsp.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"nbsp.test.js","sourceRoot":"","sources":["../../../__tests__/editor/nbsp.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAkE;AAClE,sDAAsD;AACtD,gGAAoF;AACpF,6EAAmD;AAEnD,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,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,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,SAAS,GAAG,kBAAkB,CAAA;QACpC,MAAM,cAAc,GAAG,wFAAwF,CAAA;QAC/G,MAAM,MAAM,GAAG,IAAA,2DAAwB,EAAC,SAAS,CAAC,CAAA;QAClD,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;QAC5D,MAAM,CAAC,KAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IAC/C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,0DAA0D,EAAE,KAAK,IAAI,EAAE;QACxE,OAAO,GAAG,IAAA,6BAAe,GAAE,CAAA;QAC3B,MAAM,SAAS,GAAG,4BAA4B,CAAA;QAC9C,MAAM,cAAc,GAAG,4BAA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IAAI,EAAE,SAAS,EAAE,IAAI,EAAE;KAC7C,CAAC,CAAA;AACJ,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"br.test.d.ts","sourceRoot":"","sources":["../../../__tests__/editor/br.test.tsx"],"names":[],"mappings":""}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const react_1 = require("@testing-library/react");
|
4
|
+
const prosemirror_1 = require("../utils/prosemirror");
|
5
|
+
const renderEditableGradingInstruction_1 = require("../utils/renderEditableGradingInstruction");
|
6
|
+
const act = react_1.act;
|
7
|
+
describe('Editor - BR', () => {
|
8
|
+
let cleanup;
|
9
|
+
let onContentChangeMock;
|
10
|
+
beforeEach(() => {
|
11
|
+
onContentChangeMock = jest.fn();
|
12
|
+
});
|
13
|
+
afterEach(() => {
|
14
|
+
if (cleanup) {
|
15
|
+
cleanup();
|
16
|
+
}
|
17
|
+
cleanup = null;
|
18
|
+
});
|
19
|
+
it('BR is rendered as expected', () => {
|
20
|
+
const inputData = '<p>bar<br/></p>';
|
21
|
+
const expectedOutput = '<p>bar<br><br class="ProseMirror-trailingBreak"></p>';
|
22
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData);
|
23
|
+
const table = result.container.querySelector('.ProseMirror');
|
24
|
+
expect(table.innerHTML).toBe(expectedOutput);
|
25
|
+
});
|
26
|
+
it('Change in content causes BR to be returned as expected', async () => {
|
27
|
+
cleanup = (0, prosemirror_1.mockCreateRange)();
|
28
|
+
const inputData = '<p>foo<br/></p><p>bar</p>';
|
29
|
+
const expectedOutput = '<p>foo<br/></p><p>foo</p>';
|
30
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
31
|
+
await act(async () => {
|
32
|
+
insertText(await result.findByText('bar'), 'foo');
|
33
|
+
});
|
34
|
+
expect(onContentChangeMock).toHaveBeenCalledTimes(1);
|
35
|
+
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
36
|
+
});
|
37
|
+
});
|
38
|
+
function insertText(element, text) {
|
39
|
+
react_1.fireEvent.input(element, {
|
40
|
+
target: { innerText: text, innerHTML: text }
|
41
|
+
});
|
42
|
+
}
|
43
|
+
//# sourceMappingURL=br.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"br.test.js","sourceRoot":"","sources":["../../../__tests__/editor/br.test.tsx"],"names":[],"mappings":";;AAAA,kDAAkE;AAClE,sDAAsD;AACtD,gGAAoF;AAEpF,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,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,4BAA4B,EAAE,GAAG,EAAE;QACpC,MAAM,SAAS,GAAG,iBAAiB,CAAA;QACnC,MAAM,cAAc,GAAG,sDAAsD,CAAA;QAC7E,MAAM,MAAM,GAAG,IAAA,2DAAwB,EAAC,SAAS,CAAC,CAAA;QAClD,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;QAC5D,MAAM,CAAC,KAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IAC/C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACtE,OAAO,GAAG,IAAA,6BAAe,GAAE,CAAA;QAC3B,MAAM,SAAS,GAAG,2BAA2B,CAAA;QAC7C,MAAM,cAAc,GAAG,2BAA2B,CAAA;QAClD,MAAM,MAAM,GAAG,IAAA,2DAAwB,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAA;QACvE,MAAM,GAAG,CAAC,KAAK,IAAI,EAAE;YACnB,UAAU,CAAC,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;AAEF,SAAS,UAAU,CAAC,OAAoB,EAAE,IAAY;IACpD,iBAAS,CAAC,KAAK,CAAC,OAAO,EAAE;QACvB,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE;KAC7C,CAAC,CAAA;AACJ,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hr.test.d.ts","sourceRoot":"","sources":["../../../__tests__/editor/hr.test.tsx"],"names":[],"mappings":""}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const react_1 = require("@testing-library/react");
|
4
|
+
const prosemirror_1 = require("../utils/prosemirror");
|
5
|
+
const renderEditableGradingInstruction_1 = require("../utils/renderEditableGradingInstruction");
|
6
|
+
const act = react_1.act;
|
7
|
+
describe('Editor - HR', () => {
|
8
|
+
let cleanup;
|
9
|
+
let onContentChangeMock;
|
10
|
+
beforeEach(() => {
|
11
|
+
onContentChangeMock = jest.fn();
|
12
|
+
});
|
13
|
+
afterEach(() => {
|
14
|
+
if (cleanup) {
|
15
|
+
cleanup();
|
16
|
+
}
|
17
|
+
cleanup = null;
|
18
|
+
});
|
19
|
+
it('HR is rendered as expected', () => {
|
20
|
+
const inputData = '<p>bar</p><hr/>';
|
21
|
+
const expectedOutput = '<p>bar</p><hr>';
|
22
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData);
|
23
|
+
const table = result.container.querySelector('.ProseMirror');
|
24
|
+
expect(table.innerHTML).toBe(expectedOutput);
|
25
|
+
});
|
26
|
+
it('Change in content causes HR to be returned as expected', async () => {
|
27
|
+
cleanup = (0, prosemirror_1.mockCreateRange)();
|
28
|
+
const inputData = '<p>foo</p><hr/><p>bar</p>';
|
29
|
+
const expectedOutput = '<p>foo</p><hr/><p>foo</p>';
|
30
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
31
|
+
await act(async () => {
|
32
|
+
insertText(await result.findByText('bar'), 'foo');
|
33
|
+
});
|
34
|
+
expect(onContentChangeMock).toHaveBeenCalledTimes(1);
|
35
|
+
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
36
|
+
});
|
37
|
+
});
|
38
|
+
function insertText(element, text) {
|
39
|
+
react_1.fireEvent.input(element, {
|
40
|
+
target: { innerText: text, innerHTML: text }
|
41
|
+
});
|
42
|
+
}
|
43
|
+
//# sourceMappingURL=hr.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hr.test.js","sourceRoot":"","sources":["../../../__tests__/editor/hr.test.tsx"],"names":[],"mappings":";;AAAA,kDAAkE;AAClE,sDAAsD;AACtD,gGAAoF;AAEpF,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,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,IA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AAE;KAC7C,CAAC,CAAA;AACJ,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"no-wrap.test.d.ts","sourceRoot":"","sources":["../../../__tests__/editor/no-wrap.test.tsx"],"names":[],"mappings":""}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const react_1 = require("@testing-library/react");
|
4
|
+
const prosemirror_1 = require("../utils/prosemirror");
|
5
|
+
const renderEditableGradingInstruction_1 = require("../utils/renderEditableGradingInstruction");
|
6
|
+
const act = react_1.act;
|
7
|
+
describe('Editor - e-no-wrap', () => {
|
8
|
+
let cleanup;
|
9
|
+
let onContentChangeMock;
|
10
|
+
beforeEach(() => {
|
11
|
+
onContentChangeMock = jest.fn();
|
12
|
+
});
|
13
|
+
afterEach(() => {
|
14
|
+
if (cleanup) {
|
15
|
+
cleanup();
|
16
|
+
}
|
17
|
+
cleanup = null;
|
18
|
+
});
|
19
|
+
it('HR is rendered as expected', () => {
|
20
|
+
const inputData = '<p>bar</p><hr/>';
|
21
|
+
const expectedOutput = '<p>bar</p><hr>';
|
22
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData);
|
23
|
+
const table = result.container.querySelector('.ProseMirror');
|
24
|
+
expect(table.innerHTML).toBe(expectedOutput);
|
25
|
+
});
|
26
|
+
it('Change in content causes HR to be returned as expected', async () => {
|
27
|
+
cleanup = (0, prosemirror_1.mockCreateRange)();
|
28
|
+
const inputData = '<p>foo</p><hr/><p>bar</p>';
|
29
|
+
const expectedOutput = '<p>foo</p><hr/><p>foo</p>';
|
30
|
+
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
31
|
+
await act(async () => {
|
32
|
+
insertText(await result.findByText('bar'), 'foo');
|
33
|
+
});
|
34
|
+
expect(onContentChangeMock).toHaveBeenCalledTimes(1);
|
35
|
+
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
36
|
+
});
|
37
|
+
});
|
38
|
+
function insertText(element, text) {
|
39
|
+
react_1.fireEvent.input(element, {
|
40
|
+
target: { innerText: text, innerHTML: text }
|
41
|
+
});
|
42
|
+
}
|
43
|
+
//# sourceMappingURL=no-wrap.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"no-wrap.test.js","sourceRoot":"","sources":["../../../__tests__/editor/no-wrap.test.tsx"],"names":[],"mappings":";;AAAA,kDAAkE;AAClE,sDAAsD;AACtD,gGAAoF;AAEpF,MAAM,GAAG,GAAG,WAAuD,CAAA;AAEnE,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,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,4BAA4B,EAAE,GAAG,EAAE;QACpC,MAAM,SAAS,GAAG,iBAAiB,CAAA;QACnC,MAAM,cAAc,GAAG,gBAAgB,CAAA;QACvC,MAAM,MAAM,GAAG,IAAA,2DAAwB,EAAC,SAAS,CAAC,CAAA;QAClD,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;QAC5D,MAAM,CAAC,KAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IAC/C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACtE,OAAO,GAAG,IAAA,6BAAe,GAAE,CAAA;QAC3B,MAAM,SAAS,GAAG,2BAA2B,CAAA;QA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