@digabi/exam-engine-core 22.1.6-alpha.4 → 22.1.7-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/__tests__/editor/Formula.test.js +0 -11
- package/dist/__tests__/editor/Formula.test.js.map +1 -1
- package/dist/__tests__/editor/ImageUploadButton.test.js +1 -26
- package/dist/__tests__/editor/ImageUploadButton.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 +5 -17
- package/dist/components/grading-instructions/EditableGradingInstruction.js.map +1 -1
- package/dist/components/grading-instructions/editor/schemas/formulaSchema.js +1 -8
- package/dist/components/grading-instructions/editor/schemas/formulaSchema.js.map +1 -1
- package/dist/components/grading-instructions/editor/schemas/imageSchema.d.ts.map +1 -1
- package/dist/components/grading-instructions/editor/schemas/imageSchema.js +4 -18
- package/dist/components/grading-instructions/editor/schemas/imageSchema.js.map +1 -1
- package/dist/components/grading-instructions/editor/schemas/spanWithNowrapSchema.js +1 -1
- package/dist/components/grading-instructions/editor/schemas/spanWithNowrapSchema.js.map +1 -1
- package/dist/main-bundle.js +1 -1
- package/package.json +2 -2
- package/dist/__tests__/editor/spanLang.test.d.ts +0 -2
- package/dist/__tests__/editor/spanLang.test.d.ts.map +0 -1
- package/dist/__tests__/editor/spanLang.test.js +0 -50
- package/dist/__tests__/editor/spanLang.test.js.map +0 -1
- package/dist/__tests__/editor/spanWithLang.test.d.ts +0 -2
- package/dist/__tests__/editor/spanWithLang.test.d.ts.map +0 -1
- package/dist/__tests__/editor/spanWithLang.test.js +0 -38
- package/dist/__tests__/editor/spanWithLang.test.js.map +0 -1
- package/dist/__tests__/editor/sub.test.d.ts +0 -2
- package/dist/__tests__/editor/sub.test.d.ts.map +0 -1
- package/dist/__tests__/editor/sub.test.js +0 -62
- package/dist/__tests__/editor/sub.test.js.map +0 -1
- package/dist/__tests__/editor/subSup.test.d.ts +0 -2
- package/dist/__tests__/editor/subSup.test.d.ts.map +0 -1
- package/dist/__tests__/editor/subSup.test.js +0 -50
- package/dist/__tests__/editor/subSup.test.js.map +0 -1
- package/dist/components/grading-instructions/editor/schemas/spanLang.d.ts +0 -3
- package/dist/components/grading-instructions/editor/schemas/spanLang.d.ts.map +0 -1
- package/dist/components/grading-instructions/editor/schemas/spanLang.js +0 -23
- package/dist/components/grading-instructions/editor/schemas/spanLang.js.map +0 -1
- package/dist/components/grading-instructions/editor/schemas/spanWithLangSchema.d.ts +0 -3
- package/dist/components/grading-instructions/editor/schemas/spanWithLangSchema.d.ts.map +0 -1
- package/dist/components/grading-instructions/editor/schemas/spanWithLangSchema.js +0 -19
- package/dist/components/grading-instructions/editor/schemas/spanWithLangSchema.js.map +0 -1
- package/dist/components/grading-instructions/editor/schemas/subSup.d.ts +0 -3
- package/dist/components/grading-instructions/editor/schemas/subSup.d.ts.map +0 -1
- package/dist/components/grading-instructions/editor/schemas/subSup.js +0 -23
- package/dist/components/grading-instructions/editor/schemas/subSup.js.map +0 -1
- package/dist/components/grading-instructions/editor/schemas/subSupSchema.d.ts +0 -3
- package/dist/components/grading-instructions/editor/schemas/subSupSchema.d.ts.map +0 -1
- package/dist/components/grading-instructions/editor/schemas/subSupSchema.js +0 -23
- package/dist/components/grading-instructions/editor/schemas/subSupSchema.js.map +0 -1
@@ -35,17 +35,6 @@ describe('Editor - Formula', () => {
|
|
35
35
|
expect(onContentChangeMock).toHaveBeenCalledTimes(1);
|
36
36
|
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
37
37
|
});
|
38
|
-
it('assistive-tile supports < and > characters correctly', async () => {
|
39
|
-
cleanup = (0, prosemirror_1.mockCreateRange)();
|
40
|
-
const inputData = '<p>bar</p><p><e:formula data-editor-id="e-formula" assistive-title="foobar > 0 < x">bar</e:formula></p>';
|
41
|
-
const expectedOutput = '<p>foo</p><p><e:formula assistive-title="foobar > 0 < x">bar</e:formula></p>';
|
42
|
-
const result = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(inputData, onContentChangeMock);
|
43
|
-
await act(async () => {
|
44
|
-
(0, util_1.insertText)(await result.findByText('bar'), 'foo');
|
45
|
-
});
|
46
|
-
expect(onContentChangeMock).toHaveBeenCalledTimes(1);
|
47
|
-
expect(onContentChangeMock).toHaveBeenCalledWith(expectedOutput, '');
|
48
|
-
});
|
49
38
|
it('Empty formula is removed when sending changed content', async () => {
|
50
39
|
cleanup = (0, prosemirror_1.mockCreateRange)();
|
51
40
|
const inputData = '<p>bar</p><p><e:formula data-editor-id="e-formula"></e:formula></p>';
|
@@ -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,qJAAqJ,CAAA;QACvJ,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,I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M,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"}
|
@@ -39,7 +39,7 @@ describe('ImageUploadButton', () => {
|
|
39
39
|
class: htmlAttrs.class,
|
40
40
|
src: 'foo.bar'
|
41
41
|
};
|
42
|
-
it('e:image
|
42
|
+
it('e:image tags are rendered in and rendered out with correct attributes and tags', async () => {
|
43
43
|
const container = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(`<div><p>hello</p><e:image data-editor-id="e-image" width=${htmlAttrs.width} height=${htmlAttrs.height} lang=${htmlAttrs.lang} class=${htmlAttrs.class} src=${xmlAttrs.src}></e:image></div>`, onContentChangeMock);
|
44
44
|
const image = container.getByRole('img');
|
45
45
|
for (const [key, value] of Object.entries(htmlAttrs)) {
|
@@ -64,31 +64,6 @@ describe('ImageUploadButton', () => {
|
|
64
64
|
expect(image).toHaveAttribute('src', `/${renderEditableGradingInstruction_1.mockedResolvedPath}/${renderEditableGradingInstruction_1.mockedPermanentUrl}`);
|
65
65
|
});
|
66
66
|
});
|
67
|
-
it('e:image-title tag is rendered in and out with correct attributes and tags', async () => {
|
68
|
-
const imageTitle = { default: 'Image title text', fi: 'title fi', sv: 'title sv' };
|
69
|
-
const container = (0, renderEditableGradingInstruction_1.renderGradingInstruction)(`<div>
|
70
|
-
<p>hello</p>
|
71
|
-
<e:image data-editor-id="e-image" width=${htmlAttrs.width} height=${htmlAttrs.height} lang=${htmlAttrs.lang} class=${htmlAttrs.class} src=${xmlAttrs.src}>
|
72
|
-
<e:image-title data-editor-id="e-image-title">
|
73
|
-
${imageTitle.default}
|
74
|
-
<e:localization lang="fi-FI" exam-type="hearing-impaired" e-localization="1">${imageTitle.fi}</e:localization>
|
75
|
-
<e:localization lang="sv-FI" exam-type="hearing-impaired" e-localization="1">${imageTitle.sv}</e:localization>
|
76
|
-
</e:image-title>
|
77
|
-
</e:image>
|
78
|
-
</div>`, onContentChangeMock);
|
79
|
-
const figure = container.getByRole('figure');
|
80
|
-
for (const [key, value] of Object.entries(htmlAttrs)) {
|
81
|
-
expect((0, react_1.within)(figure).getByRole('img')).toHaveAttribute(key, value);
|
82
|
-
}
|
83
|
-
expect(figure.querySelector('figcaption')).toHaveTextContent(`${imageTitle.default} ${imageTitle.fi} ${imageTitle.sv}`);
|
84
|
-
expect(figure.querySelector('figcaption [lang="fi-FI"]')).toHaveTextContent(imageTitle.fi);
|
85
|
-
expect(figure.querySelector('figcaption [lang="sv-FI"]')).toHaveTextContent(imageTitle.sv);
|
86
|
-
await act(async () => {
|
87
|
-
(0, util_1.insertText)(await container.findByText('hello'), 'hello world');
|
88
|
-
});
|
89
|
-
expect(onContentChangeMock).toHaveBeenCalledTimes(1);
|
90
|
-
expect(onContentChangeMock).toHaveBeenCalledWith(`<p>hello world</p><p><e:image lang="${xmlAttrs.lang}" class="${xmlAttrs.class}" src="${xmlAttrs.src}"><e:image-title>${imageTitle.default} <e:localization lang="fi-FI" exam-type="hearing-impaired">${imageTitle.fi}</e:localization> <e:localization lang="sv-FI" exam-type="hearing-impaired">${imageTitle.sv}</e:localization></e:image-title></e:image></p>`, '');
|
91
|
-
});
|
92
67
|
});
|
93
68
|
});
|
94
69
|
//# sourceMappingURL=ImageUploadButton.test.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ImageUploadButton.test.js","sourceRoot":"","sources":["../../../__tests__/editor/ImageUploadButton.test.tsx"],"names":[],"mappings":";;;;;AAAA,qCAAkC;AAClC,
|
1
|
+
{"version":3,"file":"ImageUploadButton.test.js","sourceRoot":"","sources":["../../../__tests__/editor/ImageUploadButton.test.tsx"],"names":[],"mappings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