mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-10-01 14:41:14 +00:00
[ACS-10083]: adds unit test for added feature
This commit is contained in:
@@ -190,6 +190,22 @@ describe('FilesComponent', () => {
|
|||||||
expect(router.navigate['calls'].argsFor(0)[0]).toEqual(['/personal-files', 'parent-id']);
|
expect(router.navigate['calls'].argsFor(0)[0]).toEqual(['/personal-files', 'parent-id']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should set decoded query as queryParams', () => {
|
||||||
|
const initialQuery = { checkList: 'TYPE:"cm:folder"' };
|
||||||
|
|
||||||
|
const encoded = btoa(JSON.stringify(initialQuery));
|
||||||
|
|
||||||
|
const mockParamMap = convertToParamMap({ q: encoded });
|
||||||
|
|
||||||
|
Object.defineProperty(component['route'], 'queryParamMap', {
|
||||||
|
value: of(mockParamMap)
|
||||||
|
});
|
||||||
|
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
expect(component.queryParams).toEqual(initialQuery);
|
||||||
|
});
|
||||||
|
|
||||||
it('should check isFilterHeaderActive to be true when filters are present in queryParamMap', () => {
|
it('should check isFilterHeaderActive to be true when filters are present in queryParamMap', () => {
|
||||||
Object.defineProperty(route, 'queryParamMap', { value: of({ params: { $thumbnail: 'TYPE:"cm:folder"' } }) });
|
Object.defineProperty(route, 'queryParamMap', { value: of({ params: { $thumbnail: 'TYPE:"cm:folder"' } }) });
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user