diff --git a/projects/player/src/app/services/element-model-element-code-mapping.service.spec.ts b/projects/player/src/app/services/element-model-element-code-mapping.service.spec.ts index 979acd4f080d44349cba143c2bb488e7549cb0c9..781dabd8cce15927ca75f6102da583b09383276e 100644 --- a/projects/player/src/app/services/element-model-element-code-mapping.service.spec.ts +++ b/projects/player/src/app/services/element-model-element-code-mapping.service.spec.ts @@ -376,23 +376,24 @@ describe('ElementModelElementCodeMappingService', () => { .toEqual([]); }); - it('should not modify the elementCode and return the code', () => { + it('should map an elementCode value to text elementModel value (text)', () => { const elementModel: TextElement = JSON.parse(JSON.stringify(text_130)); - elementModel.markingMode = 'selection'; + const expectedValue = + 'Lorem <aspect-marked style="background-color: rgb(249, 248, 113);">ipsum</aspect-marked> dolor sit amet'; expect(service.mapToElementModelValue(['6-11-#f9f871'], elementModel)) - .toEqual(['6-11-#f9f871']); + .toEqual(expectedValue); }); - it('should not modify the elementCode and return the empty array', () => { + it('should not map but return the text elementModel value (text)', () => { const elementModel: TextElement = JSON.parse(JSON.stringify(text_130)); expect(service.mapToElementModelValue([], elementModel)) - .toEqual([]); + .toEqual(elementModel.text); }); - it('should modify the undefined elementCode and return an empty array', () => { + it('should not map but return the text elementModel value (text)', () => { const elementModel: TextElement = JSON.parse(JSON.stringify(text_130)); expect(service.mapToElementModelValue(undefined, elementModel)) - .toEqual([]); + .toEqual(elementModel.text); }); it('should map an elementCode value to audio elementModel value', () => { diff --git a/test-data/element-models/text_130.json b/test-data/element-models/text_130.json index ba5d57183db54fa322772bcd2167e17977c9e045..9d685177e11de61833d73423db873cda3576a7ee 100644 --- a/test-data/element-models/text_130.json +++ b/test-data/element-models/text_130.json @@ -4,6 +4,7 @@ "width": 180, "height": 98, "text": "Lorem ipsum dolor sit amet", + "markingMode": "selection", "highlightableOrange": false, "highlightableTurquoise": false, "highlightableYellow": true,