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
576e3e21
Commit
576e3e21
authored
5 months ago
by
rhenck
Browse files
Options
Downloads
Patches
Plain Diff
[editor] Fix IDService tests to work with changed mehtod visibility
All created IDs are now always registered as well.
parent
d4bb9e18
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
projects/common/services/sanitization.service.ts
+1
-1
1 addition, 1 deletion
projects/common/services/sanitization.service.ts
projects/editor/src/app/services/id.service.spec.ts
+8
-8
8 additions, 8 deletions
projects/editor/src/app/services/id.service.spec.ts
with
9 additions
and
9 deletions
projects/common/services/sanitization.service.ts
+
1
−
1
View file @
576e3e21
...
...
@@ -88,7 +88,7 @@ export class SanitizationService {
if
(
!
idManager
.
isIdAvailable
(
element
.
id
))
{
console
.
warn
(
`Id already in:
${
element
.
id
}
! Generating a new one...`
);
this
.
repairLog
.
push
(
element
.
id
);
element
.
id
=
idManager
.
getNewID
((
element
as
UIElement
).
type
||
'
value
'
);
element
.
id
=
idManager
.
get
AndRegister
NewID
((
element
as
UIElement
).
type
||
'
value
'
);
}
idManager
.
addID
(
element
.
id
);
...
...
This diff is collapsed.
Click to expand it.
projects/editor/src/app/services/id.service.spec.ts
+
8
−
8
View file @
576e3e21
...
...
@@ -16,22 +16,22 @@ describe('IDService', () => {
idService
.
reset
();
});
it
(
'
getNewID should fail on empty string param
'
,
()
=>
{
expect
(()
=>
{
idService
.
getNewID
(
''
);
}).
toThrow
(
Error
(
'
ID-Service: No type given!
'
));
it
(
'
get
AndRegister
NewID should fail on empty string param
'
,
()
=>
{
expect
(()
=>
{
idService
.
get
AndRegister
NewID
(
''
);
}).
toThrow
(
Error
(
'
ID-Service: No type given!
'
));
});
it
(
'
getNewID should return first ID
'
,
()
=>
{
expect
(
idService
.
getNewID
(
'
text
'
)).
toBe
(
'
text_1
'
);
it
(
'
get
AndRegister
NewID should return first ID
'
,
()
=>
{
expect
(
idService
.
get
AndRegister
NewID
(
'
text
'
)).
toBe
(
'
text_1
'
);
});
it
(
'
getNewID should return different IDs - counting up
'
,
()
=>
{
idService
.
getNewID
(
'
text
'
);
expect
(
idService
.
getNewID
(
'
text
'
)).
toBe
(
'
text_2
'
);
it
(
'
get
AndRegister
NewID should return different IDs - counting up
'
,
()
=>
{
idService
.
get
AndRegister
NewID
(
'
text
'
);
expect
(
idService
.
get
AndRegister
NewID
(
'
text
'
)).
toBe
(
'
text_2
'
);
});
it
(
'
idService should return next id when one is already taken
'
,
()
=>
{
idService
.
addID
(
'
text_1
'
);
expect
(
idService
.
getNewID
(
'
text
'
)).
toBe
(
'
text_2
'
);
expect
(
idService
.
get
AndRegister
NewID
(
'
text
'
)).
toBe
(
'
text_2
'
);
});
it
(
'
isIdAvailable should return false when id is already taken
'
,
()
=>
{
...
...
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