|
|
@ -2,7 +2,7 @@ import { RouterTestingModule } from '@angular/router/testing'; |
|
|
import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest'; |
|
|
import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest'; |
|
|
import { NgxsModule, NGXS_PLUGINS, Store } from '@ngxs/store'; |
|
|
import { NgxsModule, NGXS_PLUGINS, Store } from '@ngxs/store'; |
|
|
import { environment } from '../../../../../apps/dev-app/src/environments/environment'; |
|
|
import { environment } from '../../../../../apps/dev-app/src/environments/environment'; |
|
|
import { LAYOUTS } from '../../../../theme-basic/src/public-api'; |
|
|
import { LAYOUTS } from '@abp/ng.theme.basic'; |
|
|
import { RouterOutletComponent } from '../components'; |
|
|
import { RouterOutletComponent } from '../components'; |
|
|
import { CoreModule } from '../core.module'; |
|
|
import { CoreModule } from '../core.module'; |
|
|
import { eLayoutType } from '../enums/common'; |
|
|
import { eLayoutType } from '../enums/common'; |
|
|
@ -68,27 +68,7 @@ const expectedState = { |
|
|
path: '', |
|
|
path: '', |
|
|
children: [], |
|
|
children: [], |
|
|
url: '/', |
|
|
url: '/', |
|
|
}, |
|
|
order: 1, |
|
|
{ |
|
|
|
|
|
name: 'AbpAccount::Menu:Account', |
|
|
|
|
|
path: 'account', |
|
|
|
|
|
invisible: true, |
|
|
|
|
|
layout: 'application', |
|
|
|
|
|
children: [ |
|
|
|
|
|
{ |
|
|
|
|
|
path: 'login', |
|
|
|
|
|
name: 'AbpAccount::Login', |
|
|
|
|
|
order: 1, |
|
|
|
|
|
url: '/account/login', |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
path: 'register', |
|
|
|
|
|
name: 'AbpAccount::Register', |
|
|
|
|
|
order: 2, |
|
|
|
|
|
url: '/account/register', |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
url: '/account', |
|
|
|
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: 'AbpUiNavigation::Menu:Administration', |
|
|
name: 'AbpUiNavigation::Menu:Administration', |
|
|
@ -137,17 +117,10 @@ const expectedState = { |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
url: '/tenant-management', |
|
|
url: '/tenant-management', |
|
|
|
|
|
order: 2, |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
|
], |
|
|
|
|
|
flattedRoutes: [ |
|
|
|
|
|
{ |
|
|
|
|
|
name: '::Menu:Home', |
|
|
|
|
|
path: '', |
|
|
|
|
|
children: [], |
|
|
|
|
|
url: '/', |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
{ |
|
|
name: 'AbpAccount::Menu:Account', |
|
|
name: 'AbpAccount::Menu:Account', |
|
|
path: 'account', |
|
|
path: 'account', |
|
|
@ -168,18 +141,16 @@ const expectedState = { |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
url: '/account', |
|
|
url: '/account', |
|
|
|
|
|
order: 2, |
|
|
}, |
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
flattedRoutes: [ |
|
|
{ |
|
|
{ |
|
|
path: 'login', |
|
|
name: '::Menu:Home', |
|
|
name: 'AbpAccount::Login', |
|
|
path: '', |
|
|
|
|
|
children: [], |
|
|
|
|
|
url: '/', |
|
|
order: 1, |
|
|
order: 1, |
|
|
url: '/account/login', |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
path: 'register', |
|
|
|
|
|
name: 'AbpAccount::Register', |
|
|
|
|
|
order: 2, |
|
|
|
|
|
url: '/account/register', |
|
|
|
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: 'AbpUiNavigation::Menu:Administration', |
|
|
name: 'AbpUiNavigation::Menu:Administration', |
|
|
@ -228,6 +199,7 @@ const expectedState = { |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
url: '/tenant-management', |
|
|
url: '/tenant-management', |
|
|
|
|
|
order: 2, |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
|
@ -286,6 +258,7 @@ const expectedState = { |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
url: '/tenant-management', |
|
|
url: '/tenant-management', |
|
|
|
|
|
order: 2, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
path: 'tenants', |
|
|
path: 'tenants', |
|
|
@ -294,6 +267,40 @@ const expectedState = { |
|
|
requiredPolicy: 'AbpTenantManagement.Tenants', |
|
|
requiredPolicy: 'AbpTenantManagement.Tenants', |
|
|
url: '/tenant-management/tenants', |
|
|
url: '/tenant-management/tenants', |
|
|
}, |
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'AbpAccount::Menu:Account', |
|
|
|
|
|
path: 'account', |
|
|
|
|
|
invisible: true, |
|
|
|
|
|
layout: 'application', |
|
|
|
|
|
children: [ |
|
|
|
|
|
{ |
|
|
|
|
|
path: 'login', |
|
|
|
|
|
name: 'AbpAccount::Login', |
|
|
|
|
|
order: 1, |
|
|
|
|
|
url: '/account/login', |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
path: 'register', |
|
|
|
|
|
name: 'AbpAccount::Register', |
|
|
|
|
|
order: 2, |
|
|
|
|
|
url: '/account/register', |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
url: '/account', |
|
|
|
|
|
order: 2, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
path: 'login', |
|
|
|
|
|
name: 'AbpAccount::Login', |
|
|
|
|
|
order: 1, |
|
|
|
|
|
url: '/account/login', |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
path: 'register', |
|
|
|
|
|
name: 'AbpAccount::Register', |
|
|
|
|
|
order: 2, |
|
|
|
|
|
url: '/account/register', |
|
|
|
|
|
}, |
|
|
], |
|
|
], |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
@ -340,5 +347,7 @@ describe('ConfigPlugin', () => { |
|
|
const store = spectator.get(Store); |
|
|
const store = spectator.get(Store); |
|
|
const state = store.selectSnapshot(ConfigState); |
|
|
const state = store.selectSnapshot(ConfigState); |
|
|
expect(state).toEqual(expectedState); |
|
|
expect(state).toEqual(expectedState); |
|
|
|
|
|
|
|
|
|
|
|
// console.log(JSON.stringify(state));
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|