@digabi/exam-engine-core 21.0.2-annoteta-react.0 → 21.0.3-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. package/dist/__tests__/annotations.test.d.ts.map +1 -1
  2. package/dist/__tests__/annotations.test.js +148 -60
  3. package/dist/__tests__/annotations.test.js.map +1 -1
  4. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  5. package/dist/components/RenderIf.d.ts.map +1 -1
  6. package/dist/components/attachments/Attachments.d.ts.map +1 -1
  7. package/dist/components/attachments/Attachments.js +7 -9
  8. package/dist/components/attachments/Attachments.js.map +1 -1
  9. package/dist/components/attachments/QuestionTitle.d.ts.map +1 -1
  10. package/dist/components/attachments/QuestionTitle.js +6 -4
  11. package/dist/components/attachments/QuestionTitle.js.map +1 -1
  12. package/dist/components/context/AnnotationContext.d.ts +4 -5
  13. package/dist/components/context/AnnotationContext.d.ts.map +1 -1
  14. package/dist/components/context/AnnotationContext.js.map +1 -1
  15. package/dist/components/context/AnnotationProvider.d.ts +7 -2
  16. package/dist/components/context/AnnotationProvider.d.ts.map +1 -1
  17. package/dist/components/context/AnnotationProvider.js +30 -4
  18. package/dist/components/context/AnnotationProvider.js.map +1 -1
  19. package/dist/components/context/GradingInstructionContext.d.ts +9 -0
  20. package/dist/components/context/GradingInstructionContext.d.ts.map +1 -0
  21. package/dist/components/context/GradingInstructionContext.js +3 -0
  22. package/dist/components/context/GradingInstructionContext.js.map +1 -0
  23. package/dist/components/context/IsInSidebarContext.d.ts +0 -1
  24. package/dist/components/context/IsInSidebarContext.d.ts.map +1 -1
  25. package/dist/components/context/ResultsContext.d.ts.map +1 -1
  26. package/dist/components/context/ResultsContext.js.map +1 -1
  27. package/dist/components/context/TOCContext.d.ts +0 -1
  28. package/dist/components/context/TOCContext.d.ts.map +1 -1
  29. package/dist/components/context/withContext.d.ts.map +1 -1
  30. package/dist/components/exam/ChoiceAnswer.d.ts.map +1 -1
  31. package/dist/components/exam/ChoiceAnswer.js +16 -14
  32. package/dist/components/exam/ChoiceAnswer.js.map +1 -1
  33. package/dist/components/exam/Exam.d.ts +4 -4
  34. package/dist/components/exam/Exam.d.ts.map +1 -1
  35. package/dist/components/exam/Exam.js +0 -2
  36. package/dist/components/exam/Exam.js.map +1 -1
  37. package/dist/components/exam/RichTextAnswer.d.ts +1 -1
  38. package/dist/components/exam/RichTextAnswer.d.ts.map +1 -1
  39. package/dist/components/exam/TextAnswer.d.ts.map +1 -1
  40. package/dist/components/exam/TextAnswer.js +6 -4
  41. package/dist/components/exam/TextAnswer.js.map +1 -1
  42. package/dist/components/exam/internal/ProgressBar.d.ts.map +1 -1
  43. package/dist/components/exam/internal/ProgressBar.js +1 -0
  44. package/dist/components/exam/internal/ProgressBar.js.map +1 -1
  45. package/dist/components/grading/editAnnotations.d.ts.map +1 -1
  46. package/dist/components/grading/editAnnotations.js +2 -2
  47. package/dist/components/grading/editAnnotations.js.map +1 -1
  48. package/dist/components/grading/examAnnotationUtils.d.ts +0 -1
  49. package/dist/components/grading/examAnnotationUtils.d.ts.map +1 -1
  50. package/dist/components/grading/examAnnotationUtils.js +88 -37
  51. package/dist/components/grading/examAnnotationUtils.js.map +1 -1
  52. package/dist/components/grading-instructions/EditableGradingInstruction.d.ts +5 -0
  53. package/dist/components/grading-instructions/EditableGradingInstruction.d.ts.map +1 -0
  54. package/dist/components/grading-instructions/EditableGradingInstruction.js +25 -0
  55. package/dist/components/grading-instructions/EditableGradingInstruction.js.map +1 -0
  56. package/dist/components/grading-instructions/GradingInstructionProvider.d.ts +4 -0
  57. package/dist/components/grading-instructions/GradingInstructionProvider.d.ts.map +1 -0
  58. package/dist/components/grading-instructions/GradingInstructionProvider.js +8 -0
  59. package/dist/components/grading-instructions/GradingInstructionProvider.js.map +1 -0
  60. package/dist/components/grading-instructions/GradingInstructions.d.ts.map +1 -1
  61. package/dist/components/grading-instructions/GradingInstructions.js +23 -25
  62. package/dist/components/grading-instructions/GradingInstructions.js.map +1 -1
  63. package/dist/components/shared/AnnotatableText.d.ts +5 -0
  64. package/dist/components/shared/AnnotatableText.d.ts.map +1 -0
  65. package/dist/components/shared/AnnotatableText.js +25 -0
  66. package/dist/components/shared/AnnotatableText.js.map +1 -0
  67. package/dist/components/shared/AnnotationMark.d.ts +9 -0
  68. package/dist/components/shared/AnnotationMark.d.ts.map +1 -0
  69. package/dist/components/shared/AnnotationMark.js +14 -0
  70. package/dist/components/shared/AnnotationMark.js.map +1 -0
  71. package/dist/components/shared/AnnotationPopup.d.ts.map +1 -1
  72. package/dist/components/shared/AnnotationPopup.js +12 -4
  73. package/dist/components/shared/AnnotationPopup.js.map +1 -1
  74. package/dist/components/shared/AnswerIndicator.d.ts +1 -1
  75. package/dist/components/shared/AnswerIndicator.d.ts.map +1 -1
  76. package/dist/components/shared/AnswerIndicator.js +10 -9
  77. package/dist/components/shared/AnswerIndicator.js.map +1 -1
  78. package/dist/components/shared/AnswerLengthInfo.d.ts +1 -1
  79. package/dist/components/shared/AnswerLengthInfo.d.ts.map +1 -1
  80. package/dist/components/shared/AttachmentLink.d.ts +1 -1
  81. package/dist/components/shared/AttachmentLink.d.ts.map +1 -1
  82. package/dist/components/shared/AttachmentLinks.d.ts +1 -1
  83. package/dist/components/shared/AttachmentLinks.d.ts.map +1 -1
  84. package/dist/components/shared/References.d.ts.map +1 -1
  85. package/dist/components/shared/References.js +1 -0
  86. package/dist/components/shared/References.js.map +1 -1
  87. package/dist/components/shared/TOCQuestion.js +1 -1
  88. package/dist/components/shared/TOCQuestion.js.map +1 -1
  89. package/dist/components/shared/markText.d.ts +5 -0
  90. package/dist/components/shared/markText.d.ts.map +1 -0
  91. package/dist/components/shared/markText.js +57 -0
  92. package/dist/components/shared/markText.js.map +1 -0
  93. package/dist/createRenderChildNodes.d.ts.map +1 -1
  94. package/dist/createRenderChildNodes.js +4 -88
  95. package/dist/createRenderChildNodes.js.map +1 -1
  96. package/dist/dom-utils.d.ts +1 -0
  97. package/dist/dom-utils.d.ts.map +1 -1
  98. package/dist/dom-utils.js +16 -0
  99. package/dist/dom-utils.js.map +1 -1
  100. package/dist/i18n/index.d.ts +1 -2
  101. package/dist/i18n/index.d.ts.map +1 -1
  102. package/dist/i18n/index.js.map +1 -1
  103. package/dist/main-bundle.js +1 -1
  104. package/dist/main.css +1 -1
  105. package/dist/store/answers/reducer.d.ts.map +1 -1
  106. package/dist/store/audio/reducer.d.ts.map +1 -1
  107. package/dist/store/audio/sagas.d.ts.map +1 -1
  108. package/dist/store/audio/sagas.js +3 -1
  109. package/dist/store/audio/sagas.js.map +1 -1
  110. package/dist/store/cas/reducer.d.ts.map +1 -1
  111. package/dist/store/index.d.ts +1 -2
  112. package/dist/store/index.d.ts.map +1 -1
  113. package/dist/store/listenerMiddleware.d.ts +89 -0
  114. package/dist/store/listenerMiddleware.d.ts.map +1 -0
  115. package/dist/store/listenerMiddleware.js +6 -0
  116. package/dist/store/listenerMiddleware.js.map +1 -0
  117. package/dist/store/selectors.d.ts +1 -1
  118. package/dist/types/Score.d.ts +18 -3
  119. package/dist/types/Score.d.ts.map +1 -1
  120. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"annotations.test.d.ts","sourceRoot":"","sources":["../../__tests__/annotations.test.tsx"],"names":[],"mappings":"AAWA,OAAO,2BAA2B,CAAA"}
1
+ {"version":3,"file":"annotations.test.d.ts","sourceRoot":"","sources":["../../__tests__/annotations.test.tsx"],"names":[],"mappings":"AAEA,OAAO,2BAA2B,CAAA"}
@@ -3,19 +3,20 @@ 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 exam_engine_exams_1 = require("@digabi/exam-engine-exams");
7
+ const exam_engine_mastering_1 = require("@digabi/exam-engine-mastering");
8
+ require("@testing-library/jest-dom");
6
9
  const react_1 = require("@testing-library/react");
7
10
  const user_event_1 = __importDefault(require("@testing-library/user-event"));
8
- const Exam_1 = __importDefault(require("../src/components/exam/Exam"));
9
- const GradingInstructions_1 = __importDefault(require("../src/components/grading-instructions/GradingInstructions"));
10
11
  const fs_1 = require("fs");
11
- const exam_engine_mastering_1 = require("@digabi/exam-engine-mastering");
12
- const exam_engine_exams_1 = require("@digabi/exam-engine-exams");
13
12
  const path_1 = __importDefault(require("path"));
14
- const parseExam_1 = __importDefault(require("../dist/parser/parseExam"));
15
- const examServerApi_1 = require("./examServerApi");
16
13
  const react_2 = __importDefault(require("react"));
17
- require("@testing-library/jest-dom");
14
+ const parseExam_1 = __importDefault(require("../dist/parser/parseExam"));
18
15
  const Attachments_1 = __importDefault(require("../src/components/attachments/Attachments"));
16
+ const Exam_1 = __importDefault(require("../src/components/exam/Exam"));
17
+ const GradingInstructions_1 = __importDefault(require("../src/components/grading-instructions/GradingInstructions"));
18
+ const examServerApi_1 = require("./examServerApi");
19
+ const lodash_1 = require("lodash");
19
20
  class IntersectionObserver {
20
21
  constructor() {
21
22
  this.root = null;
@@ -49,114 +50,201 @@ describe('Annotations', () => {
49
50
  window.scrollTo.mockReset();
50
51
  document.execCommand.mockReset();
51
52
  });
52
- const defaultTextToAnnotate = 'Sekä moraali että tavat pyrkivät ohjaamaan ihmisten käyttäytymistä.';
53
- const defaultAnnotationAnchor = 'e:exam:-1 > e:section:1 > e:question:2 > e:question-instruction:1 > span:0 > p:0 > #text:0';
53
+ // Do NOT modify the line breaks and indentations below
54
+ const defaultTextToAnnotate = `
55
+ Valitse jokin pienempi tai suurempi yhteisö – esimerkiksi jokin koulu, katsomuksellinen ryhmä tai valtio –
56
+ ja pohdi, mikä ero valitsemassasi yhteisössä on moraalin ja tapojen välillä.
57
+ `;
58
+ const defaultAnnotationAnchor = 'e:exam:0 > e:section:1 > e:question:2 > e:question-instruction:1 > span:0 > p:1 > #text:0';
54
59
  it('popup is rendered', async () => {
55
- const exam = (0, react_1.render)(react_2.default.createElement(Exam_1.default, { ...getExamProps(), annotations: {}, onClickAnnotation: () => { }, onSaveAnnotation: () => { } }));
56
- await annotateText(exam, defaultTextToAnnotate);
60
+ const exam = (0, react_1.render)(react_2.default.createElement(Exam_1.default, { ...getExamProps(), annotations: [], onClickAnnotation: () => { }, onSaveAnnotation: () => { } }));
61
+ await annotateText(exam, defaultAnnotationAnchor);
57
62
  expect(exam.getByTestId('annotation-popup')).toBeVisible();
58
63
  });
59
64
  it('popup is not rendered if annotation props are not passed', async () => {
60
65
  const exam = (0, react_1.render)(react_2.default.createElement(Exam_1.default, { ...getExamProps() }));
61
- await annotateText(exam, defaultTextToAnnotate);
66
+ const text = 'Sekä moraali että tavat pyrkivät ohjaamaan ihmisten käyttäytymistä.';
67
+ const textElement = exam.getByText(text);
68
+ mockWindowSelection(text, textElement, text.length);
69
+ await user_event_1.default.click(textElement);
62
70
  expect(exam.queryByTestId('annotation-popup')).not.toBeInTheDocument();
63
71
  });
64
72
  it('callback is called when annotation is saved', async () => {
65
73
  const saveAnnotationMock = jest.fn();
66
- const exam = (0, react_1.render)(react_2.default.createElement(Exam_1.default, { ...getExamProps(), annotations: {}, onClickAnnotation: () => { }, onSaveAnnotation: saveAnnotationMock }));
67
- await annotateText(exam, defaultTextToAnnotate);
74
+ const exam = (0, react_1.render)(react_2.default.createElement(Exam_1.default, { ...getExamProps(), annotations: [], onClickAnnotation: () => { }, onSaveAnnotation: saveAnnotationMock }));
75
+ await annotateText(exam, defaultAnnotationAnchor);
68
76
  const textbox = exam.getByTestId('edit-comment');
69
77
  react_1.fireEvent.input(textbox, {
70
- target: { innerText: 'New Value', innerHTML: 'New Value' }
78
+ target: { innerText: 'New comment', innerHTML: 'New comment' }
71
79
  });
72
- await user_event_1.default.click(exam.getByText('Vastaa'));
80
+ await user_event_1.default.click(exam.getByText('Tallenna'));
81
+ const annotationPart = {
82
+ annotationAnchor: defaultAnnotationAnchor,
83
+ selectedText: defaultTextToAnnotate,
84
+ startIndex: 0,
85
+ length: defaultTextToAnnotate.length
86
+ };
73
87
  expect(saveAnnotationMock).toHaveBeenCalledTimes(1);
74
88
  expect(saveAnnotationMock).toHaveBeenCalledWith({
75
- annotationAnchor: defaultAnnotationAnchor,
76
- annotationId: undefined,
89
+ annotationParts: [annotationPart],
77
90
  displayNumber: '2',
78
- length: defaultTextToAnnotate.length,
79
- message: 'New Value',
80
- selectedText: defaultTextToAnnotate,
81
- startIndex: 67
82
- });
91
+ selectedText: defaultTextToAnnotate
92
+ }, 'New comment');
83
93
  });
84
94
  it('popup field is empty when creating new annotation', async () => {
85
- const exam = (0, react_1.render)(react_2.default.createElement(Exam_1.default, { ...getExamProps(), annotations: {}, onClickAnnotation: () => { }, onSaveAnnotation: () => { } }));
86
- await annotateText(exam, defaultTextToAnnotate);
95
+ const annotationAnchor_7_1 = 'e:exam:0 > e:section:2 > e:question:7 > e:question:7.1 > e:question-title:0 > span:0 > #text:0';
96
+ const exam = (0, react_1.render)(react_2.default.createElement(Exam_1.default, { ...getExamProps(), annotations: [], onClickAnnotation: () => { }, onSaveAnnotation: () => { } }));
97
+ await annotateText(exam, defaultAnnotationAnchor);
87
98
  const textbox = exam.getByTestId('edit-comment');
88
99
  react_1.fireEvent.input(textbox, {
89
100
  target: { innerText: 'New Value', innerHTML: 'New Value' }
90
101
  });
91
- await user_event_1.default.click(exam.getByText('Vastaa'));
92
- await annotateText(exam, 'Esitä jokin toinen käsitys filosofiasta ja vertaa sitä');
102
+ await user_event_1.default.click(exam.getByText('Tallenna'));
103
+ // text picked by getMarkedText includes leading/trailing whitespace, so they must be here too
104
+ await annotateText(exam, annotationAnchor_7_1);
93
105
  expect(exam.getByTestId('edit-comment').textContent).toHaveLength(0);
94
106
  });
95
107
  it('callback is called when annotation is clicked', async () => {
96
108
  const clickAnnotationMock = jest.fn();
97
- const exam = (0, react_1.render)(react_2.default.createElement(Exam_1.default, { ...getExamProps(), annotations: { [defaultAnnotationAnchor]: [createAnnotation(1, 1, 1)] }, onClickAnnotation: clickAnnotationMock, onSaveAnnotation: () => { } }));
109
+ const exam = (0, react_1.render)(react_2.default.createElement(Exam_1.default, { ...getExamProps(), annotations: createAnnotations([{ id: 1, startIndex: 5, selectedText: 'moraali että' }]), onClickAnnotation: clickAnnotationMock, onSaveAnnotation: () => { } }));
98
110
  await user_event_1.default.click(exam.container.querySelector('[data-annotation-id="1"]'));
99
- expect(clickAnnotationMock).toHaveBeenCalledTimes(1);
100
- expect(clickAnnotationMock).toHaveBeenCalledWith(expect.anything(), {
111
+ const clickedAnnotation = {
101
112
  annotationAnchor: defaultAnnotationAnchor,
102
113
  annotationId: 1,
103
- displayNumber: '',
104
114
  hidden: false,
105
- length: 1,
106
- message: '',
107
- selectedText: '',
108
- startIndex: 1
109
- });
115
+ length: 12,
116
+ selectedText: 'moraali että',
117
+ startIndex: 5,
118
+ markNumber: 1
119
+ };
120
+ expect(clickAnnotationMock).toHaveBeenCalledTimes(1);
121
+ expect(clickAnnotationMock).toHaveBeenCalledWith(expect.anything(), clickedAnnotation);
110
122
  });
111
123
  it('annotations are added to dom when provided', () => {
124
+ var _a, _b;
112
125
  const annotationProps = {
113
- annotations: {
114
- [defaultAnnotationAnchor]: [createAnnotation(1, 1, 1), createAnnotation(3, 4, 2)]
115
- },
126
+ annotations: createAnnotations([
127
+ { id: 1, startIndex: 27, selectedText: 'pienempi' },
128
+ { id: 3, startIndex: 166, selectedText: 'yhteisössä' }
129
+ ]),
116
130
  onClickAnnotation: () => { },
117
131
  onSaveAnnotation: () => { }
118
132
  };
119
133
  const exam = (0, react_1.render)(react_2.default.createElement(Exam_1.default, { ...getExamProps(), ...annotationProps }));
120
134
  expect(exam.container.querySelector('[data-annotation-id="1"]')).toBeInTheDocument();
135
+ expect((_a = exam.container.querySelector('[data-annotation-id="1"]')) === null || _a === void 0 ? void 0 : _a.textContent).toBe('pienempi');
136
+ expect(exam.container.querySelector('[data-annotation-id="1"] sup')).toHaveAttribute('data-content', '1');
121
137
  expect(exam.container.querySelector('[data-annotation-id="3"]')).toBeInTheDocument();
138
+ expect((_b = exam.container.querySelector('[data-annotation-id="3"]')) === null || _b === void 0 ? void 0 : _b.textContent).toBe('yhteisössä');
139
+ expect(exam.container.querySelector('[data-annotation-id="3"] sup')).toHaveAttribute('data-content', '2');
140
+ });
141
+ it('"August 2024" annotations are added to dom when provided', () => {
142
+ var _a;
143
+ /** the difference of startIndex between an "August 2024 annotation" and a normal annotation
144
+ * (in this case, but the index varies depending on the exam content)
145
+ */
146
+ const startIndexDifference = 24;
147
+ const annotationProps = {
148
+ annotations: createAnnotations([{ id: 1, startIndex: 166 - startIndexDifference, selectedText: 'yhteisössä' }]),
149
+ onClickAnnotation: () => { },
150
+ onSaveAnnotation: () => { }
151
+ };
152
+ const exam = (0, react_1.render)(react_2.default.createElement(Exam_1.default, { ...getExamProps(), ...annotationProps }));
153
+ expect(exam.container.querySelector('[data-annotation-id="1"]')).toBeInTheDocument();
154
+ expect((_a = exam.container.querySelector('[data-annotation-id="1"]')) === null || _a === void 0 ? void 0 : _a.textContent).toBe('yhteisössä');
155
+ expect(exam.container.querySelector('[data-annotation-id="1"] sup')).toHaveAttribute('data-content', '1');
156
+ });
157
+ it('if two annotations have same id, only latter renders <sup>', () => {
158
+ const annotationProps = {
159
+ annotations: createAnnotations([
160
+ { id: 1, startIndex: 71, selectedText: 'jokin' },
161
+ { id: 1, startIndex: 77, selectedText: 'koulu' },
162
+ { id: 2, startIndex: 142, selectedText: 'mikä' },
163
+ { id: 2, startIndex: 147, selectedText: 'ero' }
164
+ ]),
165
+ onClickAnnotation: () => { },
166
+ onSaveAnnotation: () => { }
167
+ };
168
+ const exam = (0, react_1.render)(react_2.default.createElement(Exam_1.default, { ...getExamProps(), ...annotationProps }));
169
+ const marks = (id) => exam.container.querySelectorAll(`.e-annotation[data-annotation-id="${id}"]`);
170
+ const marksId1 = marks('1');
171
+ const marksId2 = marks('2');
172
+ expect(marksId1[0].textContent).toBe('jokin');
173
+ expect(marksId1[0].querySelector('sup')).not.toBeInTheDocument();
174
+ expect(marksId1[1].textContent).toBe('koulu');
175
+ expect(marksId1[1]).toBeInTheDocument();
176
+ expect(marksId1[1].querySelector('sup')).toHaveAttribute('data-content', '1');
177
+ expect(marksId2[0].textContent).toBe('mikä');
178
+ expect(marksId2[0].querySelector('sup')).not.toBeInTheDocument();
179
+ expect(marksId2[1].textContent).toBe('ero');
180
+ expect(marksId2[1]).toBeInTheDocument();
181
+ expect(marksId2[1].querySelector('sup')).toHaveAttribute('data-content', '2');
182
+ });
183
+ it('hidden annotation works correctly', () => {
184
+ var _a, _b;
185
+ const annotations = createAnnotations([{ id: 1, startIndex: 59, selectedText: 'esimerkiksi', hidden: true }]);
186
+ const annotationProps = {
187
+ annotations,
188
+ onClickAnnotation: () => { },
189
+ onSaveAnnotation: () => { }
190
+ };
191
+ const exam = (0, react_1.render)(react_2.default.createElement(Exam_1.default, { ...getExamProps(), ...annotationProps }));
192
+ expect(exam.container.querySelector('[data-annotation-id="1"]')).toBeInTheDocument();
193
+ expect(exam.container.querySelector('[data-annotation-id="1"] sup')).not.toBeInTheDocument();
194
+ expect((_b = (_a = exam.container.querySelector('[data-annotation-id="1"]')) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.textContent).toBe(defaultTextToAnnotate);
122
195
  });
123
196
  it('grading instructions can be annotated', async () => {
124
- const gi = (0, react_1.render)(react_2.default.createElement(GradingInstructions_1.default, { ...getCommonProps(), annotations: {}, onClickAnnotation: () => { }, onSaveAnnotation: () => { } }));
125
- await annotateText(gi, defaultTextToAnnotate);
197
+ const gi = (0, react_1.render)(react_2.default.createElement(GradingInstructions_1.default, { ...getCommonProps(), annotations: [], onClickAnnotation: () => { }, onSaveAnnotation: () => { } }));
198
+ await annotateText(gi, defaultAnnotationAnchor);
126
199
  expect(gi.getByTestId('annotation-popup')).toBeVisible();
127
200
  });
128
201
  it('attachments can be annotated', async () => {
129
- const gi = (0, react_1.render)(react_2.default.createElement(Attachments_1.default, { ...getCommonProps(), annotations: {}, onClickAnnotation: () => { }, onSaveAnnotation: () => { } }));
130
- await annotateText(gi, 'Mollit sint magna aliquip in.');
202
+ const annotationAnchor_7_A = 'e:exam:0 > e:section:2 > e:question:7 > e:external-material:3 > e:attachment:0 > span:1 > p:3 > #text:0';
203
+ const gi = (0, react_1.render)(react_2.default.createElement(Attachments_1.default, { ...getCommonProps(), annotations: [], onClickAnnotation: () => { }, onSaveAnnotation: () => { } }));
204
+ await annotateText(gi, annotationAnchor_7_A);
131
205
  expect(gi.getByTestId('annotation-popup')).toBeVisible();
132
206
  });
133
- function createAnnotation(id, startIndex, length) {
134
- return {
135
- annotationId: id,
136
- annotationAnchor: defaultAnnotationAnchor,
137
- hidden: false,
138
- startIndex,
139
- length,
140
- message: '',
141
- displayNumber: '',
142
- selectedText: ''
143
- };
207
+ function createAnnotations(annotations) {
208
+ const annotationsById = (0, lodash_1.groupBy)(annotations, 'id');
209
+ return Object.keys(annotationsById).map((id, index) => {
210
+ const annotationParts = annotationsById[id];
211
+ return {
212
+ annotationId: Number(id),
213
+ selectedText: annotations.map(a => a.selectedText).join(' '),
214
+ type: 'text',
215
+ displayNumber: '2',
216
+ hidden: annotationParts.some(a => a.hidden),
217
+ markNumber: index + 1,
218
+ annotationParts: annotationParts.map(p => ({
219
+ startIndex: p.startIndex,
220
+ length: p.selectedText.length,
221
+ annotationAnchor: defaultAnnotationAnchor,
222
+ selectedText: p.selectedText,
223
+ annotationId: Number(id)
224
+ }))
225
+ };
226
+ });
144
227
  }
145
- async function annotateText(exam, text) {
146
- mockWindowSelection(text, text.length);
147
- const textElement = exam.getByText(text);
228
+ async function annotateText(exam, elementAnchor) {
229
+ const textElement = exam.getByTestId(elementAnchor);
230
+ const fullText = (textElement === null || textElement === void 0 ? void 0 : textElement.textContent) || '';
231
+ const annotationLength = fullText.length;
232
+ const text = fullText.substring(0, annotationLength);
233
+ mockWindowSelection(text, textElement, annotationLength);
148
234
  await user_event_1.default.click(textElement);
149
235
  }
150
- function mockWindowSelection(text = 'mocked selection text', length = 5) {
236
+ function mockWindowSelection(text = 'mocked selection text', element, length) {
151
237
  ;
152
238
  window.getSelection.mockImplementation(() => ({
153
239
  toString: () => text,
154
240
  rangeCount: 1,
241
+ anchorNode: element.firstChild,
242
+ focusNode: element.firstChild,
155
243
  getRangeAt: jest.fn().mockReturnValue({
156
244
  startOffset: 0,
157
245
  endOffset: length,
158
- startContainer: {},
159
- endContainer: {},
246
+ startContainer: element,
247
+ endContainer: element,
160
248
  cloneContents: jest.fn().mockReturnValue({ children: [], childNodes: [] })
161
249
  })
162
250
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"annotations.test.js","sourceRoot":"","sources":["../../__tests__/annotations.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAwE;AACxE,6EAAmD;AACnD,uEAA8E;AAC9E,qHAA4F;AAC5F,2BAAmC;AACnC,yEAAyF;AACzF,iEAAuD;AACvD,gDAAuB;AACvB,yEAAgD;AAChD,mDAA+C;AAC/C,kDAAyB;AACzB,qCAAkC;AAClC,4FAAmE;AAGnE,MAAM,oBAAoB;IAA1B;QACE,SAAI,GAAG,IAAI,CAAA;QACX,eAAU,GAAG,EAAE,CAAA;QACf,eAAU,GAAG,EAAE,CAAA;QACf,eAAU,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA;QACvB,YAAO,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA;QACpB,gBAAW,GAAG,GAAG,EAAE,CAAC,EAAE,CAAA;QACtB,cAAS,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA;IACxB,CAAC;CAAA;AACD,MAAM,CAAC,oBAAoB,GAAG,oBAAoB,CAAA;AAClD,MAAM,CAAC,oBAAoB,GAAG,oBAAoB,CAAA;AAClD,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;AAC3B,QAAQ,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;AAEhC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,IAAI,GAAgB,CAAA;IAEpB,UAAU,CAAC,KAAK,IAAI,EAAE;Q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