-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ACS-6252] support disabling the tags and categories feature in the applications #9106
[ACS-6252] support disabling the tags and categories feature in the applications #9106
Conversation
lib/content-services/src/lib/aspect-list/aspect-list-dialog.component.spec.ts
Outdated
Show resolved
Hide resolved
spyOn(nodeService, 'getNode').and.returnValue(delayResult); | ||
spyOn(aspectListService, 'getAspects').and.returnValue(delayResult); | ||
spyOn(nodeService, 'getNode').and.returnValue(of(null).pipe(delay(0))); | ||
spyOn(aspectListService, 'getAspects').and.returnValue(of([]).pipe(delay(0))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does adding delay(0) have any difference as opposed to not having it at all? I would assume the default value for delay is 0 anyways
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
lib/content-services/src/lib/aspect-list/services/dialog-aspect-list.service.spec.ts
Outdated
Show resolved
Hide resolved
it('should not show aspect if it is excluded aspect', () => { | ||
component.excludedAspects = ['cst:nonamedAspect']; | ||
|
||
fixture.detectChanges(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought maybe we can leave fixture.detectChanges();
call in beforeEach and just call it again only in this test case? I know that it will be called twice but then you wouldn't have to manually call it in every other test case, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't call it twice because it is in ngOnInit which be triggered for first execution of detectChanges. But I have prepared now two separate describe blocks so now I can use detectChanges in beforeEach for rest tests.
it('should return true if get from AppConfigService returns true', () => { | ||
getSpy.and.returnValue(true); | ||
|
||
const enabledCategories = categoryService.areCategoriesEnabled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you don't need to create a extra variable here, you can just call areCategoriesEnabled
in the expect block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, done
it('should return false if get from AppConfigService returns false', () => { | ||
getSpy.and.returnValue(false); | ||
|
||
const enabledCategories = categoryService.areCategoriesEnabled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
it('should return true if get from AppConfigService returns true', () => { | ||
getSpy.and.returnValue(true); | ||
|
||
const enabledTags = service.areTagsEnabled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
it('should return false if get from AppConfigService returns false', () => { | ||
getSpy.and.returnValue(false); | ||
|
||
const enabledTags = service.areTagsEnabled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
9057263
to
eb22223
Compare
…tegories features are disabled
eb22223
to
2180e96
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behaviour? (You can also link to an open issue here)
https://alfresco.atlassian.net/browse/ACS-6252
What is the new behaviour?
Allowing to hide things related with tags and categories features.
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information:
ACA PR: Alfresco/alfresco-content-app#3533
alfresco-applications PR: https://github.com/Alfresco/alfresco-applications/pull/439