@digabi/exam-engine-core 23.27.0 → 23.27.1
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/dist/__tests__/playwright/exam/TextAnswerInput.test.js +43 -2
- package/dist/__tests__/playwright/exam/TextAnswerInput.test.js.map +1 -1
- package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
- package/dist/components/shared/AnswerLengthInfo.js +1 -1
- package/dist/components/shared/AnswerLengthInfo.js.map +1 -1
- package/dist/i18n/fi-FI.js +1 -1
- package/dist/i18n/fi-FI.js.map +1 -1
- package/dist/i18n/sv-FI.js +1 -1
- package/dist/i18n/sv-FI.js.map +1 -1
- package/dist/main-bundle.js +2 -2
- package/dist/main-bundle.js.LICENSE.txt +1 -1
- package/package.json +16 -16
|
@@ -10,14 +10,36 @@ experimental_ct_react_1.test.describe('TextAnswerInput', () => {
|
|
|
10
10
|
(0, experimental_ct_react_1.test)('integer input accepts unicode minus sign', async ({ mount }) => {
|
|
11
11
|
const component = await mount(react_1.default.createElement(Question_story_1.QuestionStory, { examXml: examXml }));
|
|
12
12
|
await component.locator('input').type('−5');
|
|
13
|
-
await (0, experimental_ct_react_1.expect)(component.locator('input')).toHaveValue('
|
|
13
|
+
await (0, experimental_ct_react_1.expect)(component.locator('input')).toHaveValue('−5');
|
|
14
14
|
});
|
|
15
15
|
(0, experimental_ct_react_1.test)('integer input accepts ascii hyphen minus sign', async ({ mount }) => {
|
|
16
16
|
const component = await mount(react_1.default.createElement(Question_story_1.QuestionStory, { examXml: examXml }));
|
|
17
17
|
await component.locator('input').type('-5');
|
|
18
|
-
await (0, experimental_ct_react_1.expect)(component.locator('input')).toHaveValue('
|
|
18
|
+
await (0, experimental_ct_react_1.expect)(component.locator('input')).toHaveValue('-5');
|
|
19
|
+
});
|
|
20
|
+
(0, experimental_ct_react_1.test)('rich text undo and redo move a whole debounced edit at a time', async ({ mount, page }) => {
|
|
21
|
+
// The editor's answer history is debounced by 500 ms, so everything typed within a
|
|
22
|
+
// single burst must be undone and redone as one step, not character by character.
|
|
23
|
+
const historyTimeout = 550;
|
|
24
|
+
const component = await mount(react_1.default.createElement(Question_story_1.QuestionStory, { examXml: richTextExamXml }));
|
|
25
|
+
const editor = component.getByTestId('rich-text-editor');
|
|
26
|
+
await editor.click();
|
|
27
|
+
await page.keyboard.type('aa');
|
|
28
|
+
await page.waitForTimeout(historyTimeout);
|
|
29
|
+
await page.keyboard.type('bb');
|
|
30
|
+
await page.waitForTimeout(historyTimeout);
|
|
31
|
+
await (0, experimental_ct_react_1.expect)(editor).toHaveText('aabb');
|
|
32
|
+
await page.keyboard.press('ControlOrMeta+z');
|
|
33
|
+
await (0, experimental_ct_react_1.expect)(editor).toHaveText('aa');
|
|
34
|
+
await page.keyboard.press('ControlOrMeta+z');
|
|
35
|
+
await (0, experimental_ct_react_1.expect)(editor).toHaveText('');
|
|
36
|
+
await page.keyboard.press(redoShortcut);
|
|
37
|
+
await (0, experimental_ct_react_1.expect)(editor).toHaveText('aa');
|
|
38
|
+
await page.keyboard.press(redoShortcut);
|
|
39
|
+
await (0, experimental_ct_react_1.expect)(editor).toHaveText('aabb');
|
|
19
40
|
});
|
|
20
41
|
});
|
|
42
|
+
const redoShortcut = process.platform === 'darwin' ? 'Meta+Shift+z' : 'Control+y';
|
|
21
43
|
const examXml = `<e:exam xmlns:e="http://ylioppilastutkinto.fi/exam.xsd" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ylioppilastutkinto.fi/exam.xsd https://abitti.net/schema/exam.xsd" exam-schema-version="0.5">
|
|
22
44
|
<e:exam-versions>
|
|
23
45
|
<e:exam-version lang="fi-FI"/>
|
|
@@ -37,4 +59,23 @@ const examXml = `<e:exam xmlns:e="http://ylioppilastutkinto.fi/exam.xsd" xmlns="
|
|
|
37
59
|
</e:question>
|
|
38
60
|
</e:section>
|
|
39
61
|
</e:exam>`;
|
|
62
|
+
const richTextExamXml = `<e:exam xmlns:e="http://ylioppilastutkinto.fi/exam.xsd" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ylioppilastutkinto.fi/exam.xsd https://abitti.net/schema/exam.xsd" exam-schema-version="0.5" exam-lang="fi-FI">
|
|
63
|
+
<e:exam-versions>
|
|
64
|
+
<e:exam-version lang="fi-FI"/>
|
|
65
|
+
</e:exam-versions>
|
|
66
|
+
<e:exam-title>Exam</e:exam-title>
|
|
67
|
+
<e:exam-instruction/>
|
|
68
|
+
<e:table-of-contents/>
|
|
69
|
+
<e:section>
|
|
70
|
+
<e:section-title>Section</e:section-title>
|
|
71
|
+
<e:section-instruction/>
|
|
72
|
+
<e:question display-number="1" question-id="1" max-score="6">
|
|
73
|
+
<e:question-title>Tekstitehtävä</e:question-title>
|
|
74
|
+
<e:question-instruction>
|
|
75
|
+
<br/>
|
|
76
|
+
</e:question-instruction>
|
|
77
|
+
<e:text-answer type="rich-text" max-score="6" question-id="2" display-number="1"/>
|
|
78
|
+
</e:question>
|
|
79
|
+
</e:section>
|
|
80
|
+
</e:exam>`;
|
|
40
81
|
//# sourceMappingURL=TextAnswerInput.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextAnswerInput.test.js","sourceRoot":"","sources":["../../../../__tests__/playwright/exam/TextAnswerInput.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,6EAAgE;AAChE,mEAA8D;AAE9D,4BAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IACpC,IAAA,4BAAI,EAAC,0CAA0C,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QACnE,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,8BAAC,8BAAa,IAAC,OAAO,EAAE,OAAO,GAAI,CAAC,CAAA;QAClE,MAAM,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,C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