Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
verona-modules-aspect
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IQB
verona-modules-aspect
Commits
f2666347
Commit
f2666347
authored
2 years ago
by
jojohoch
Browse files
Options
Downloads
Patches
Plain Diff
[player] Remove tests for mapping values of simple drop list
parent
4b1481b1
No related branches found
No related tags found
No related merge requests found
Pipeline
#42141
passed
2 years ago
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
projects/player/src/app/services/element-model-element-code-mapping.service.spec.ts
+0
-63
0 additions, 63 deletions
...rvices/element-model-element-code-mapping.service.spec.ts
with
0 additions
and
63 deletions
projects/player/src/app/services/element-model-element-code-mapping.service.spec.ts
+
0
−
63
View file @
f2666347
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
*
as
dropList_130
from
'
test-data/element-models/drop-list_130.json
'
;
import
*
as
dropList_130
from
'
test-data/element-models/drop-list_130.json
'
;
import
*
as
dropListSimple_131
from
'
test-data/element-models/drop-list-simple_131.json
'
;
import
*
as
textField_130
from
'
test-data/element-models/text-field_130.json
'
;
import
*
as
textField_130
from
'
test-data/element-models/text-field_130.json
'
;
import
*
as
textFieldSimple_131
from
'
test-data/element-models/text-field-simple_131.json
'
;
import
*
as
textFieldSimple_131
from
'
test-data/element-models/text-field-simple_131.json
'
;
import
*
as
image_130
from
'
test-data/element-models/image_130.json
'
;
import
*
as
image_130
from
'
test-data/element-models/image_130.json
'
;
...
@@ -16,9 +15,6 @@ import * as hotspotImage_135 from 'test-data/element-models/hotspot-image_135.js
...
@@ -16,9 +15,6 @@ import * as hotspotImage_135 from 'test-data/element-models/hotspot-image_135.js
import
*
as
dragNDropValues_01_130
from
'
test-data/values/dragNDropValues_01_130.json
'
;
import
*
as
dragNDropValues_01_130
from
'
test-data/values/dragNDropValues_01_130.json
'
;
import
*
as
dragNDropValues_02_130
from
'
test-data/values/dragNDropValues_02_130.json
'
;
import
*
as
dragNDropValues_02_130
from
'
test-data/values/dragNDropValues_02_130.json
'
;
import
{
DropListElement
}
from
'
common/models/elements/input-elements/drop-list
'
;
import
{
DropListElement
}
from
'
common/models/elements/input-elements/drop-list
'
;
import
{
DropListSimpleElement
}
from
'
common/models/elements/compound-elements/cloze/cloze-child-elements/drop-list-simple
'
;
import
{
TextElement
}
from
'
common/models/elements/text/text
'
;
import
{
TextElement
}
from
'
common/models/elements/text/text
'
;
import
{
AudioElement
}
from
'
common/models/elements/media-elements/audio
'
;
import
{
AudioElement
}
from
'
common/models/elements/media-elements/audio
'
;
import
{
ImageElement
}
from
'
common/models/elements/media-elements/image
'
;
import
{
ImageElement
}
from
'
common/models/elements/media-elements/image
'
;
...
@@ -55,12 +51,6 @@ describe('ElementModelElementCodeMappingService', () => {
...
@@ -55,12 +51,6 @@ describe('ElementModelElementCodeMappingService', () => {
.
toEqual
([
'
value_1
'
,
'
value_2
'
,
'
value_3
'
]);
.
toEqual
([
'
value_1
'
,
'
value_2
'
,
'
value_3
'
]);
});
});
it
(
'
should map the value of a drop-list-simple elementModel to its elementCode value
'
,
()
=>
{
const
dragNDropValueObjects
:
DragNDropValueObject
[]
=
JSON
.
parse
(
JSON
.
stringify
(
dragNDropValues_01_130
)).
default
;
expect
(
service
.
mapToElementCodeValue
(
dragNDropValueObjects
,
'
drop-list-simple
'
))
.
toEqual
([
'
value_1
'
,
'
value_2
'
,
'
value_3
'
]);
});
it
(
'
should map the value of a text elementModel to its elementCode value
'
,
()
=>
{
it
(
'
should map the value of a text elementModel to its elementCode value
'
,
()
=>
{
const
textValue
=
const
textValue
=
'
Lorem <aspect-marked style="background-color: rgb(249, 248, 113);">ipsum</aspect-marked> dolor sit amet
'
;
'
Lorem <aspect-marked style="background-color: rgb(249, 248, 113);">ipsum</aspect-marked> dolor sit amet
'
;
...
@@ -331,44 +321,6 @@ describe('ElementModelElementCodeMappingService', () => {
...
@@ -331,44 +321,6 @@ describe('ElementModelElementCodeMappingService', () => {
.
toEqual
(
expectedValue
);
.
toEqual
(
expectedValue
);
});
});
it
(
'
should not map but return the drop-list-simple elementModel value
'
,
()
=>
{
service
.
dragNDropValueObjects
=
[
{
text
:
'
a
'
,
id
:
'
value_1
'
,
imgSrc
:
null
,
imgPosition
:
'
above
'
},
{
text
:
'
b
'
,
id
:
'
value_2
'
,
imgSrc
:
null
,
imgPosition
:
'
above
'
},
{
text
:
'
c
'
,
id
:
'
value_3
'
,
imgSrc
:
null
,
imgPosition
:
'
above
'
},
{
text
:
'
d
'
,
id
:
'
value_4
'
,
imgSrc
:
null
,
imgPosition
:
'
above
'
},
{
text
:
'
e
'
,
id
:
'
value_5
'
,
imgSrc
:
null
,
imgPosition
:
'
above
'
}
];
const
elementModel
:
DropListSimpleElement
=
JSON
.
parse
(
JSON
.
stringify
(
dropListSimple_131
));
expect
(
service
.
mapToElementModelValue
(
undefined
,
elementModel
))
.
toEqual
(
elementModel
.
value
);
});
it
(
'
should map an elementCode value to drop-list elementModel value with imageSrc
'
,
()
=>
{
it
(
'
should map an elementCode value to drop-list elementModel value with imageSrc
'
,
()
=>
{
service
.
dragNDropValueObjects
=
JSON
.
parse
(
JSON
.
stringify
(
dragNDropValues_01_130
)).
default
;
service
.
dragNDropValueObjects
=
JSON
.
parse
(
JSON
.
stringify
(
dragNDropValues_01_130
)).
default
;
const
elementModel
:
DropListElement
=
JSON
.
parse
(
JSON
.
stringify
(
dropList_130
));
const
elementModel
:
DropListElement
=
JSON
.
parse
(
JSON
.
stringify
(
dropList_130
));
...
@@ -377,14 +329,6 @@ describe('ElementModelElementCodeMappingService', () => {
...
@@ -377,14 +329,6 @@ describe('ElementModelElementCodeMappingService', () => {
.
toEqual
(
expectedValue
);
.
toEqual
(
expectedValue
);
});
});
it
(
'
should map an elementCode value to drop-list-simple elementModel value with imageSrc
'
,
()
=>
{
service
.
dragNDropValueObjects
=
JSON
.
parse
(
JSON
.
stringify
(
dragNDropValues_01_130
)).
default
;
const
elementModel
:
DropListSimpleElement
=
JSON
.
parse
(
JSON
.
stringify
(
dropListSimple_131
));
const
expectedValue
=
JSON
.
parse
(
JSON
.
stringify
(
dragNDropValues_02_130
)).
default
;
expect
(
service
.
mapToElementModelValue
([
'
value_1
'
,
'
value_2
'
],
elementModel
))
.
toEqual
(
expectedValue
);
});
it
(
'
should map an elementCode value to drop-list-simple elementModel value - an empty array
'
,
()
=>
{
it
(
'
should map an elementCode value to drop-list-simple elementModel value - an empty array
'
,
()
=>
{
service
.
dragNDropValueObjects
=
JSON
.
parse
(
JSON
.
stringify
(
dragNDropValues_01_130
)).
default
;
service
.
dragNDropValueObjects
=
JSON
.
parse
(
JSON
.
stringify
(
dragNDropValues_01_130
)).
default
;
const
elementModel
:
DropListElement
=
JSON
.
parse
(
JSON
.
stringify
(
dropList_130
));
const
elementModel
:
DropListElement
=
JSON
.
parse
(
JSON
.
stringify
(
dropList_130
));
...
@@ -392,13 +336,6 @@ describe('ElementModelElementCodeMappingService', () => {
...
@@ -392,13 +336,6 @@ describe('ElementModelElementCodeMappingService', () => {
.
toEqual
([]);
.
toEqual
([]);
});
});
it
(
'
should map an elementCode value to drop-list elementModel value - an empty array
'
,
()
=>
{
service
.
dragNDropValueObjects
=
JSON
.
parse
(
JSON
.
stringify
(
dragNDropValues_01_130
)).
default
;
const
elementModel
:
DropListSimpleElement
=
JSON
.
parse
(
JSON
.
stringify
(
dropListSimple_131
));
expect
(
service
.
mapToElementModelValue
([],
elementModel
))
.
toEqual
([]);
});
it
(
'
should map an elementCode value to text elementModel value (text)
'
,
()
=>
{
it
(
'
should map an elementCode value to text elementModel value (text)
'
,
()
=>
{
const
elementModel
:
TextElement
=
JSON
.
parse
(
JSON
.
stringify
(
text_130
));
const
elementModel
:
TextElement
=
JSON
.
parse
(
JSON
.
stringify
(
text_130
));
const
expectedValue
=
const
expectedValue
=
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment