From 9e6e940db8252392e1bba4a281bb423db8f454f0 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 22 Apr 2020 00:34:09 +0300 Subject: [PATCH] test: use CoreModule.forRoot in config plugin tests --- .../core/src/lib/tests/config.plugin.spec.ts | 25 ++++--------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/npm/ng-packs/packages/core/src/lib/tests/config.plugin.spec.ts b/npm/ng-packs/packages/core/src/lib/tests/config.plugin.spec.ts index aa0e0f553f..a45ab25993 100644 --- a/npm/ng-packs/packages/core/src/lib/tests/config.plugin.spec.ts +++ b/npm/ng-packs/packages/core/src/lib/tests/config.plugin.spec.ts @@ -1,16 +1,15 @@ import { RouterTestingModule } from '@angular/router/testing'; import { createServiceFactory, SpectatorService } from '@ngneat/spectator/jest'; -import { NgxsModule, NGXS_PLUGINS, Store } from '@ngxs/store'; +import { NgxsModule, Store } from '@ngxs/store'; +import { OAuthModule } from 'angular-oauth2-oidc'; import { environment } from '../../../../../apps/dev-app/src/environments/environment'; -import { LAYOUTS } from '@abp/ng.theme.basic'; import { RouterOutletComponent } from '../components'; import { CoreModule } from '../core.module'; import { eLayoutType } from '../enums/common'; import { ABP } from '../models'; -import { ConfigPlugin, NGXS_CONFIG_PLUGIN_OPTIONS } from '../plugins'; +import { ConfigPlugin } from '../plugins'; import { ConfigState } from '../states'; import { addAbpRoutes } from '../utils'; -import { OAuthModule } from 'angular-oauth2-oidc'; addAbpRoutes([ { @@ -60,9 +59,6 @@ addAbpRoutes([ const expectedState = { environment, - requirements: { - layouts: LAYOUTS, - }, routes: [ { name: '::Menu:Home', @@ -323,9 +319,9 @@ describe('ConfigPlugin', () => { const createService = createServiceFactory({ service: ConfigPlugin, imports: [ - CoreModule, + NgxsModule.forRoot([ConfigState]), + CoreModule.forRoot({ environment }), OAuthModule.forRoot(), - NgxsModule.forRoot([]), RouterTestingModule.withRoutes([ { path: '', @@ -341,17 +337,6 @@ describe('ConfigPlugin', () => { { path: 'tenant-management', component: RouterOutletComponent }, ]), ], - providers: [ - { - provide: NGXS_PLUGINS, - useClass: ConfigPlugin, - multi: true, - }, - { - provide: NGXS_CONFIG_PLUGIN_OPTIONS, - useValue: { environment, requirements: { layouts: LAYOUTS } } as ABP.Root, - }, - ], }); beforeEach(() => {