@digabi/exam-engine-core 23.2.0 → 23.2.1-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
- package/dist/components/exam/AllDNDOptions.d.ts.map +1 -1
- package/dist/components/exam/AllDNDOptions.js +2 -2
- package/dist/components/exam/AllDNDOptions.js.map +1 -1
- package/dist/components/exam/DNDAnswer.d.ts.map +1 -1
- package/dist/components/exam/DNDAnswer.js +1 -1
- package/dist/components/exam/DNDAnswer.js.map +1 -1
- package/dist/components/exam/DNDAnswerContainer.d.ts.map +1 -1
- package/dist/components/exam/DNDAnswerContainer.js +17 -19
- package/dist/components/exam/DNDAnswerContainer.js.map +1 -1
- package/dist/components/exam/DNDAnswerOption.d.ts +1 -1
- package/dist/components/exam/DNDAnswerOption.d.ts.map +1 -1
- package/dist/components/exam/DNDAnswerOption.js +1 -1
- package/dist/components/exam/DNDAnswerOption.js.map +1 -1
- package/dist/components/exam/DNDAnswerTitleCommon.d.ts +4 -0
- package/dist/components/exam/DNDAnswerTitleCommon.d.ts.map +1 -0
- package/dist/components/exam/DNDAnswerTitleCommon.js +14 -0
- package/dist/components/exam/DNDAnswerTitleCommon.js.map +1 -0
- package/dist/components/exam/DragAndDrop.d.ts +3 -0
- package/dist/components/exam/DragAndDrop.d.ts.map +1 -0
- package/dist/components/exam/DragAndDrop.js +7 -0
- package/dist/components/exam/DragAndDrop.js.map +1 -0
- package/dist/components/exam/NativeDND.d.ts +3 -0
- package/dist/components/exam/NativeDND.d.ts.map +1 -0
- package/dist/components/exam/NativeDND.js +75 -0
- package/dist/components/exam/NativeDND.js.map +1 -0
- package/dist/components/exam/getter.d.ts +3 -0
- package/dist/components/exam/getter.d.ts.map +1 -0
- package/dist/components/exam/getter.js +86 -0
- package/dist/components/exam/getter.js.map +1 -0
- package/dist/components/grading/AnnotatableGradingAnswer.d.ts +4 -0
- package/dist/components/grading/AnnotatableGradingAnswer.d.ts.map +1 -0
- package/dist/components/grading/AnnotatableGradingAnswer.js +24 -0
- package/dist/components/grading/AnnotatableGradingAnswer.js.map +1 -0
- package/dist/components/results/CorrectDNDAnswer.d.ts +4 -0
- package/dist/components/results/CorrectDNDAnswer.d.ts.map +1 -0
- package/dist/components/results/CorrectDNDAnswer.js +22 -0
- package/dist/components/results/CorrectDNDAnswer.js.map +1 -0
- package/dist/components/results/DNDAnswer.d.ts.map +1 -1
- package/dist/components/results/DNDAnswer.js +11 -9
- package/dist/components/results/DNDAnswer.js.map +1 -1
- package/dist/components/results/DNDAnswerOptionResults.d.ts +4 -0
- package/dist/components/results/DNDAnswerOptionResults.d.ts.map +1 -0
- package/dist/components/results/DNDAnswerOptionResults.js +4 -0
- package/dist/components/results/DNDAnswerOptionResults.js.map +1 -0
- package/dist/components/shared/AnnotationWrapper.d.ts +5 -0
- package/dist/components/shared/AnnotationWrapper.d.ts.map +1 -0
- package/dist/components/shared/AnnotationWrapper.js +24 -0
- package/dist/components/shared/AnnotationWrapper.js.map +1 -0
- package/dist/components/shared/DNDAnswerCommon.d.ts +1 -2
- package/dist/components/shared/DNDAnswerCommon.d.ts.map +1 -1
- package/dist/components/shared/DNDAnswerCommon.js +5 -2
- package/dist/components/shared/DNDAnswerCommon.js.map +1 -1
- package/dist/components/shared/DNDAnswerDroppable.d.ts +2 -3
- package/dist/components/shared/DNDAnswerDroppable.d.ts.map +1 -1
- package/dist/components/shared/DNDAnswerDroppable.js +7 -8
- package/dist/components/shared/DNDAnswerDroppable.js.map +1 -1
- package/dist/components/shared/DNDAnswerDroppableCommon.d.ts +13 -0
- package/dist/components/shared/DNDAnswerDroppableCommon.d.ts.map +1 -0
- package/dist/components/shared/DNDAnswerDroppableCommon.js +30 -0
- package/dist/components/shared/DNDAnswerDroppableCommon.js.map +1 -0
- package/dist/components/shared/DNDAnswerOption.d.ts +7 -0
- package/dist/components/shared/DNDAnswerOption.d.ts.map +1 -0
- package/dist/components/shared/DNDAnswerOption.js +14 -0
- package/dist/components/shared/DNDAnswerOption.js.map +1 -0
- package/dist/components/shared/DNDAnswerOptionCommon.d.ts +1 -1
- package/dist/components/shared/DNDAnswerOptionCommon.d.ts.map +1 -1
- package/dist/components/shared/DNDAnswerOptionCommon.js +1 -1
- package/dist/components/shared/DNDAnswerOptionCommon.js.map +1 -1
- package/dist/components/shared/DNDAnswerTitleCommon.d.ts +4 -0
- package/dist/components/shared/DNDAnswerTitleCommon.d.ts.map +1 -0
- package/dist/components/shared/DNDAnswerTitleCommon.js +14 -0
- package/dist/components/shared/DNDAnswerTitleCommon.js.map +1 -0
- package/dist/components/shared/DNDTitleAndAnswer.d.ts +12 -0
- package/dist/components/shared/DNDTitleAndAnswer.d.ts.map +1 -0
- package/dist/components/shared/DNDTitleAndAnswer.js +48 -0
- package/dist/components/shared/DNDTitleAndAnswer.js.map +1 -0
- package/dist/components/shared/DNDTitleAndAnswerCommon.d.ts +3 -4
- package/dist/components/shared/DNDTitleAndAnswerCommon.d.ts.map +1 -1
- package/dist/components/shared/DNDTitleAndAnswerCommon.js +30 -9
- package/dist/components/shared/DNDTitleAndAnswerCommon.js.map +1 -1
- package/dist/components/shared/Mark.d.ts +9 -0
- package/dist/components/shared/Mark.d.ts.map +1 -0
- package/dist/components/shared/Mark.js +14 -0
- package/dist/components/shared/Mark.js.map +1 -0
- package/dist/components/shared/internal/RestrictedAudioPlayerCommon.d.ts +12 -0
- package/dist/components/shared/internal/RestrictedAudioPlayerCommon.d.ts.map +1 -0
- package/dist/components/shared/internal/RestrictedAudioPlayerCommon.js +29 -0
- package/dist/components/shared/internal/RestrictedAudioPlayerCommon.js.map +1 -0
- package/dist/components/shared/internal/RestrictedAudioPlayerExam.d.ts +13 -0
- package/dist/components/shared/internal/RestrictedAudioPlayerExam.d.ts.map +1 -0
- package/dist/components/shared/internal/RestrictedAudioPlayerExam.js +33 -0
- package/dist/components/shared/internal/RestrictedAudioPlayerExam.js.map +1 -0
- package/dist/main-bundle.js +5 -5
- package/package.json +2 -2
- package/dist/__tests__/playwright/DNDAnswerContainer.test.d.ts +0 -2
- package/dist/__tests__/playwright/DNDAnswerContainer.test.d.ts.map +0 -1
- package/dist/__tests__/playwright/DNDAnswerContainer.test.js +0 -77
- package/dist/__tests__/playwright/DNDAnswerContainer.test.js.map +0 -1
- package/dist/__tests__/playwright/stories/DNDAnswerContainer.story.d.ts +0 -10
- package/dist/__tests__/playwright/stories/DNDAnswerContainer.story.d.ts.map +0 -1
- package/dist/__tests__/playwright/stories/DNDAnswerContainer.story.js +0 -21
- package/dist/__tests__/playwright/stories/DNDAnswerContainer.story.js.map +0 -1
- package/dist/__tests__/playwright/utils/ComponentWrapper.d.ts +0 -9
- package/dist/__tests__/playwright/utils/ComponentWrapper.d.ts.map +0 -1
- package/dist/__tests__/playwright/utils/ComponentWrapper.js +0 -26
- package/dist/__tests__/playwright/utils/ComponentWrapper.js.map +0 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@digabi/exam-engine-core",
|
3
|
-
"version": "23.2.0",
|
3
|
+
"version": "23.2.1-alpha.0",
|
4
4
|
"main": "dist/main-bundle.js",
|
5
5
|
"types": "dist/index.d.ts",
|
6
6
|
"author": "Matriculation Examination Board, Finland",
|
@@ -59,5 +59,5 @@
|
|
59
59
|
"webpack-bundle-analyzer": "^4.1.0",
|
60
60
|
"webpack-cli": "^5.0.2"
|
61
61
|
},
|
62
|
-
"gitHead": "
|
62
|
+
"gitHead": "4dff3cba67a38dcc9828869a8cab7b5eff7d4ecf"
|
63
63
|
}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"DNDAnswerContainer.test.d.ts","sourceRoot":"","sources":["../../../__tests__/playwright/DNDAnswerContainer.test.tsx"],"names":[],"mappings":""}
|
@@ -1,77 +0,0 @@
|
|
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 = __importDefault(require("react"));
|
7
|
-
const fs_1 = require("fs");
|
8
|
-
const path_1 = __importDefault(require("path"));
|
9
|
-
const experimental_ct_react_1 = require("@playwright/experimental-ct-react");
|
10
|
-
const exam_engine_exams_1 = require("@digabi/exam-engine-exams");
|
11
|
-
const exam_engine_mastering_1 = require("@digabi/exam-engine-mastering");
|
12
|
-
const DNDAnswerContainer_story_1 = require("./stories/DNDAnswerContainer.story");
|
13
|
-
experimental_ct_react_1.test.describe('DNDAnswerContainer', () => {
|
14
|
-
let masteredExam;
|
15
|
-
experimental_ct_react_1.test.beforeAll(async () => {
|
16
|
-
masteredExam = await setupMasteredExam();
|
17
|
-
});
|
18
|
-
for (const answerMediaType of ['text', 'image']) {
|
19
|
-
(0, experimental_ct_react_1.test)(`Connect - basic drag and drop functionality for ${answerMediaType} answers`, async ({ mount }) => {
|
20
|
-
const component = await mount(react_1.default.createElement(DNDAnswerContainer_story_1.DNDAnswerContainerStory, { masteredExam: masteredExam, answerMediaType: answerMediaType }));
|
21
|
-
const { answerContainer, answerOptionsLocator, firstAnswerLocator, secondAnswerLocator, firstAnswerContent, secondAnswerContent } = await setupAnswerContext(component, answerMediaType);
|
22
|
-
await experimental_ct_react_1.test.step('Drag first answer to answer container', async () => {
|
23
|
-
const draggableLocator = firstAnswerLocator.locator('.drag-handle');
|
24
|
-
await draggableLocator.dragTo(answerContainer);
|
25
|
-
await assertContentMatches(answerContainer, firstAnswerContent, answerMediaType);
|
26
|
-
});
|
27
|
-
await experimental_ct_react_1.test.step('Replace first answer with second answer in answer container', async () => {
|
28
|
-
const draggableLocator = secondAnswerLocator.locator('.drag-handle');
|
29
|
-
await draggableLocator.dragTo(answerContainer);
|
30
|
-
await assertContentMatches(answerContainer, secondAnswerContent, answerMediaType);
|
31
|
-
});
|
32
|
-
await experimental_ct_react_1.test.step('Drag second answer back to options', async () => {
|
33
|
-
const draggableLocator = answerContainer.locator('.drag-handle');
|
34
|
-
await draggableLocator.dragTo(answerOptionsLocator);
|
35
|
-
await (0, experimental_ct_react_1.expect)(answerContainer).toContainText('Ei vastausta');
|
36
|
-
});
|
37
|
-
});
|
38
|
-
}
|
39
|
-
});
|
40
|
-
async function setupMasteredExam() {
|
41
|
-
const examPath = (0, exam_engine_exams_1.resolveExam)('SC/SC.xml');
|
42
|
-
const resolveAttachment = (filename) => path_1.default.resolve(path_1.default.dirname(examPath), 'attachments', filename);
|
43
|
-
const examXml = (0, fs_1.readFileSync)(examPath, 'utf-8');
|
44
|
-
const [masteredExam] = await (0, exam_engine_mastering_1.masterExam)(examXml, () => '', (0, exam_engine_mastering_1.getMediaMetadataFromLocalFile)(resolveAttachment), {
|
45
|
-
removeCorrectAnswers: true
|
46
|
-
});
|
47
|
-
return masteredExam;
|
48
|
-
}
|
49
|
-
async function assertContentMatches(answerContainer, content, mediaType) {
|
50
|
-
if (mediaType === 'text') {
|
51
|
-
await (0, experimental_ct_react_1.expect)(answerContainer).toContainText(content);
|
52
|
-
}
|
53
|
-
else if (mediaType === 'image') {
|
54
|
-
await (0, experimental_ct_react_1.expect)(answerContainer.locator('img')).toHaveAttribute('src', content);
|
55
|
-
}
|
56
|
-
}
|
57
|
-
async function setupAnswerContext(component, answerMediaType) {
|
58
|
-
const answerContainer = component.getByTestId('dnd-droppable').first();
|
59
|
-
const answerOptionsLocator = component.getByTestId('dnd-droppable').last();
|
60
|
-
const firstAnswerLocator = component.getByTestId('dnd-answer-option').nth(0);
|
61
|
-
const secondAnswerLocator = component.getByTestId('dnd-answer-option').nth(1);
|
62
|
-
const firstAnswerContent = answerMediaType === 'text'
|
63
|
-
? await firstAnswerLocator.textContent()
|
64
|
-
: await firstAnswerLocator.locator('img').getAttribute('src');
|
65
|
-
const secondAnswerContent = answerMediaType === 'text'
|
66
|
-
? await secondAnswerLocator.textContent()
|
67
|
-
: await secondAnswerLocator.locator('img').getAttribute('src');
|
68
|
-
return {
|
69
|
-
answerContainer,
|
70
|
-
answerOptionsLocator,
|
71
|
-
firstAnswerLocator,
|
72
|
-
secondAnswerLocator,
|
73
|
-
firstAnswerContent: firstAnswerContent,
|
74
|
-
secondAnswerContent: secondAnswerContent
|
75
|
-
};
|
76
|
-
}
|
77
|
-
//# sourceMappingURL=DNDAnswerContainer.test.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"DNDAnswerContainer.test.js","sourceRoot":"","sources":["../../../__tests__/playwright/DNDAnswerContainer.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,2BAAiC;AACjC,gDAAuB;AACvB,6EAAgE;AAEhE,iEAAuD;AACvD,yEAA0G;AAC1G,iFAA4E;AAE5E,4BAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IACvC,IAAI,YAA6B,CAAA;IAEjC,4BAAI,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACxB,YAAY,GAAG,MAAM,iBAAiB,EAAE,CAAA;IAC1C,CAAC,CAAC,CAAA;IAEF,KAAK,MAAM,eAAe,IAAI,CAAC,MAAM,EAAE,OAAO,CAAU,EAAE,CAAC;QACzD,IAAA,4BAAI,EAAC,mDAAmD,eAAe,UAAU,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;YACrG,MAAM,SAAS,GAAG,MAAM,KAAK,CAC3B,8BAAC,kDAAuB,IAAC,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,GAAI,CAC1F,CAAA;YACD,MAAM,EACJ,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACpB,GAAG,MAAM,kBAAkB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAA;YAExD,MAAM,4BAAI,CAAC,IAAI,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;gBAClE,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;gBACnE,MAAM,gBAAgB,CAAC,MAAM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BAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;IAElE,OAAO;QACL,eAAe;QACf,oBAAoB;QACpB,kBAAkB;QAClB,mBAAmB;QACnB,kBAAkB,EAAE,kBAA4B;QAChD,mBAAmB,EAAE,mBAA6B;KACnD,CAAA;AACH,CAAC"}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { MasteringResult } from '@digabi/exam-engine-mastering';
|
3
|
-
export type answerMediaType = 'text' | 'image';
|
4
|
-
interface DNDAnswerContainerStoryProps {
|
5
|
-
masteredExam: MasteringResult;
|
6
|
-
answerMediaType: answerMediaType;
|
7
|
-
}
|
8
|
-
export declare const DNDAnswerContainerStory: React.FC<DNDAnswerContainerStoryProps>;
|
9
|
-
export {};
|
10
|
-
//# sourceMappingURL=DNDAnswerContainer.story.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"DNDAnswerContainer.story.d.ts","sourceRoot":"","sources":["../../../../__tests__/playwright/stories/DNDAnswerContainer.story.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAO/D,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,CAAA;AAE9C,UAAU,4BAA4B;IACpC,YAAY,EAAE,eAAe,CAAA;IAC7B,eAAe,EAAE,eAAe,CAAA;CACjC;AAED,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAc1E,CAAA"}
|
@@ -1,21 +0,0 @@
|
|
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
|
-
exports.DNDAnswerContainerStory = void 0;
|
7
|
-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
8
|
-
const react_1 = __importDefault(require("react"));
|
9
|
-
const Exam_1 = require("../../../src/components/exam/Exam");
|
10
|
-
const DNDAnswerContainer_1 = require("../../../src/components/exam/DNDAnswerContainer");
|
11
|
-
const ComponentWrapper_1 = require("../utils/ComponentWrapper");
|
12
|
-
const parseExam_1 = __importDefault(require("../../../src/parser/parseExam"));
|
13
|
-
const dom_utils_1 = require("../../../src/dom-utils");
|
14
|
-
const DNDAnswerContainerStory = ({ masteredExam, answerMediaType }) => {
|
15
|
-
const doc = (0, parseExam_1.default)(masteredExam.xml, true);
|
16
|
-
const [textAnswers, imageAnswers] = (0, dom_utils_1.queryAll)(doc.documentElement, 'dnd-answer-container');
|
17
|
-
return (react_1.default.createElement(ComponentWrapper_1.ComponentWrapper, { doc: doc, resolveAttachment: (filename) => `/${masteredExam.examCode}/attachments/${filename}` },
|
18
|
-
react_1.default.createElement(DNDAnswerContainer_1.DNDAnswerContainer, { element: answerMediaType === 'text' ? textAnswers : imageAnswers, renderChildNodes: Exam_1.renderChildNodes })));
|
19
|
-
};
|
20
|
-
exports.DNDAnswerContainerStory = DNDAnswerContainerStory;
|
21
|
-
//# sourceMappingURL=DNDAnswerContainer.story.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"DNDAnswerContainer.story.js","sourceRoot":"","sources":["../../../../__tests__/playwright/stories/DNDAnswerContainer.story.tsx"],"names":[],"mappings":";;;;;;AAAA,4DAA4D;AAC5D,kDAAyB;AAEzB,4DAAoE;AACpE,wFAAoF;AACpF,gEAA4D;AAC5D,8EAAqD;AACrD,sDAAiD;AAS1C,MAAM,uBAAuB,GAA2C,CAAC,EAAE,YAAY,EAAE,eAAe,EAAE,EAAE,EAAE;IACnH,MAAM,GAAG,GAAG,IAAA,mBAAS,EAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC7C,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,GAAG,IAAA,oBAAQ,EAAC,GAAG,CAAC,eAAe,EAAE,sBAAsB,CAAC,CAAA;IACzF,OAAO,CACL,8BAAC,mCAAgB,IACf,GAAG,EAAE,GAAG,EACR,iBAAiB,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,IAAI,YAAY,CAAC,QAAQ,gBAAgB,QAAQ,EAAE;QAE5F,8BAAC,uCAAkB,IACjB,OAAO,EAAE,eAAe,KAAK,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,EAChE,gBAAgB,EAAE,uBAAgB,GACd,CACL,CACpB,CAAA;AACH,CAAC,CAAA;AAdY,QAAA,uBAAuB,2BAcnC"}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { CommonExamProps } from '../../../src/components/exam/Exam';
|
3
|
-
import '../../../src/css/main.less';
|
4
|
-
export interface ComponentWrapperProps extends CommonExamProps {
|
5
|
-
doc: XMLDocument;
|
6
|
-
children: React.ReactElement;
|
7
|
-
}
|
8
|
-
export declare const ComponentWrapper: React.ComponentType<any>;
|
9
|
-
//# sourceMappingURL=ComponentWrapper.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ComponentWrapper.d.ts","sourceRoot":"","sources":["../../../../__tests__/playwright/utils/ComponentWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,4BAA4B,CAAA;AAEnC,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D,GAAG,EAAE,WAAW,CAAA;IAChB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAA;CAC7B;AAeD,eAAO,MAAM,gBAAgB,0BAA2D,CAAA"}
|
@@ -1,26 +0,0 @@
|
|
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
|
-
exports.ComponentWrapper = void 0;
|
7
|
-
const react_1 = __importDefault(require("react"));
|
8
|
-
const react_redux_1 = require("react-redux");
|
9
|
-
const react_i18next_1 = require("react-i18next");
|
10
|
-
const store_1 = require("../../../src/store");
|
11
|
-
const parseExamStructure_1 = require("../../../src/parser/parseExamStructure");
|
12
|
-
const useCached_1 = require("../../../src/useCached");
|
13
|
-
const examServerApi_1 = require("../../examServerApi");
|
14
|
-
const i18n_1 = require("../../../src/i18n");
|
15
|
-
const CommonExamContext_1 = require("../../../src/components/context/CommonExamContext");
|
16
|
-
const ExamContext_1 = require("../../../src/components/context/ExamContext");
|
17
|
-
require("../../../src/css/main.less");
|
18
|
-
const WrappedComponent = ({ doc, children }) => {
|
19
|
-
const i18n = (0, useCached_1.useCached)(() => (0, i18n_1.initI18n)('fi-FI'));
|
20
|
-
const store = (0, useCached_1.useCached)(() => (0, store_1.initializeExamStore)((0, parseExamStructure_1.parseExamStructure)(doc), 'allowed', [], [], examServerApi_1.examServerApi));
|
21
|
-
return (react_1.default.createElement(react_redux_1.Provider, { store: store },
|
22
|
-
react_1.default.createElement(react_i18next_1.I18nextProvider, { i18n: i18n },
|
23
|
-
react_1.default.createElement("div", { className: "e-exam" }, children))));
|
24
|
-
};
|
25
|
-
exports.ComponentWrapper = (0, ExamContext_1.withExamContext)((0, CommonExamContext_1.withCommonExamContext)(WrappedComponent));
|
26
|
-
//# sourceMappingURL=ComponentWrapper.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ComponentWrapper.js","sourceRoot":"","sources":["../../../../__tests__/playwright/utils/ComponentWrapper.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AACzB,6CAAsC;AACtC,iDAA+C;AAC/C,8CAAwD;AACxD,+EAA2E;AAC3E,sDAAkD;AAClD,uDAAmD;AACnD,4CAA4C;AAC5C,yFAAyF;AACzF,6EAA6E;AAE7E,sCAAmC;AAOnC,MAAM,gBAAgB,GAAoC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9E,MAAM,IAAI,GAAG,IAAA,qBAAS,EAAC,GAAG,EAAE,CAAC,IAAA,eAAQ,EAAC,OAAO,CAAC,CAAC,CAAA;IAC/C,MAAM,KAAK,GAAG,IAAA,qBAAS,EAAC,GAAG,EAAE,CAAC,IAAA,2BAAmB,EAAC,IAAA,uCAAkB,EAAC,GAAG,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,6BAAa,CAAC,CAAC,CAAA;IAE7G,OAAO,CACL,8BAAC,sBAAQ,IAAC,KAAK,EAAE,KAAK;QACpB,8BAAC,+BAAe,IAAC,IAAI,EAAE,IAAI;YACzB,uCAAK,SAAS,EAAC,QAAQ,IAAE,QAAQ,CAAO,CACxB,CACT,CACZ,CAAA;AACH,CAAC,CAAA;AAEY,QAAA,gBAAgB,GAAG,IAAA,6BAAe,EAAC,IAAA,yCAAqB,EAAC,gBAAgB,CAAC,CAAC,CAAA"}
|