mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACS-9510] Tasks and processes are not displayed when About page is refreshed (#4510)
* [ACS-9510] Tasks and processes are not displayed when About page is refreshed * [ACS-9510] Tasks and processes are not displayed when About page is refreshed
This commit is contained in:
parent
215881b0cd
commit
0118c21bb0
@ -41,6 +41,7 @@ describe('RouterExtensionService', () => {
|
|||||||
let guard1;
|
let guard1;
|
||||||
let guard2;
|
let guard2;
|
||||||
let guard3;
|
let guard3;
|
||||||
|
let guard4;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component1 = { name: 'component-1' };
|
component1 = { name: 'component-1' };
|
||||||
@ -50,6 +51,7 @@ describe('RouterExtensionService', () => {
|
|||||||
guard1 = { name: 'guard1' };
|
guard1 = { name: 'guard1' };
|
||||||
guard2 = { name: 'guard2' };
|
guard2 = { name: 'guard2' };
|
||||||
guard3 = { name: 'guard3' };
|
guard3 = { name: 'guard3' };
|
||||||
|
guard4 = { name: 'guard4' };
|
||||||
|
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [LibTestingModule],
|
imports: [LibTestingModule],
|
||||||
@ -62,6 +64,7 @@ describe('RouterExtensionService', () => {
|
|||||||
getAuthGuards: (authKeys) => {
|
getAuthGuards: (authKeys) => {
|
||||||
const authMapping = {
|
const authMapping = {
|
||||||
'app.auth': guard1,
|
'app.auth': guard1,
|
||||||
|
'app.extensions.dataLoaderGuard': guard4,
|
||||||
'ext.auth1': guard2,
|
'ext.auth1': guard2,
|
||||||
'ext.auth2': guard3
|
'ext.auth2': guard3
|
||||||
};
|
};
|
||||||
@ -135,18 +138,18 @@ describe('RouterExtensionService', () => {
|
|||||||
expect(service.getApplicationRoutes()[0].component).toBe(component1);
|
expect(service.getApplicationRoutes()[0].component).toBe(component1);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should calculate the "canActivateChild" and "canActivate" to default auth guard, if no "auth" defined for the route', () => {
|
it('should calculate the "canActivateChild" and "canActivate" to default guards, if no "auth" defined for the route', () => {
|
||||||
extensionService.routes = [getDummyRoute({ auth: undefined })];
|
extensionService.routes = [getDummyRoute({ auth: undefined })];
|
||||||
|
|
||||||
expect(service.getApplicationRoutes()[0].canActivateChild).toEqual([guard1]);
|
expect(service.getApplicationRoutes()[0].canActivateChild).toEqual([guard1, guard4]);
|
||||||
expect(service.getApplicationRoutes()[0].canActivate).toEqual([guard1]);
|
expect(service.getApplicationRoutes()[0].canActivate).toEqual([guard1, guard4]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should calculate the "canActivateChild" and "canActivate" to default auth guard, if "auth" is defined as [] for the route', () => {
|
it('should calculate the "canActivateChild" and "canActivate" to default guards, if "auth" is defined as [] for the route', () => {
|
||||||
extensionService.routes = [getDummyRoute({ auth: [] })];
|
extensionService.routes = [getDummyRoute({ auth: [] })];
|
||||||
|
|
||||||
expect(service.getApplicationRoutes()[0].canActivateChild).toEqual([guard1]);
|
expect(service.getApplicationRoutes()[0].canActivateChild).toEqual([guard1, guard4]);
|
||||||
expect(service.getApplicationRoutes()[0].canActivate).toEqual([guard1]);
|
expect(service.getApplicationRoutes()[0].canActivate).toEqual([guard1, guard4]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should calculate the "canActivateChild" and "canActivate" to the registered guard(s) matching the "auth" value of the route', () => {
|
it('should calculate the "canActivateChild" and "canActivate" to the registered guard(s) matching the "auth" value of the route', () => {
|
||||||
|
@ -33,7 +33,7 @@ import { Router } from '@angular/router';
|
|||||||
export class RouterExtensionService {
|
export class RouterExtensionService {
|
||||||
defaults = {
|
defaults = {
|
||||||
layout: 'app.layout.main',
|
layout: 'app.layout.main',
|
||||||
auth: ['app.auth']
|
auth: ['app.auth', 'app.extensions.dataLoaderGuard']
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(private router: Router, protected extensions: ExtensionService) {}
|
constructor(private router: Router, protected extensions: ExtensionService) {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user