Browse Source

fix: linter warnings

pull/4793/head
mehmet-erim 6 years ago
parent
commit
380586ac7f
  1. 4
      npm/ng-packs/packages/account/src/lib/tests/account.service.spec.ts
  2. 4
      npm/ng-packs/packages/core/src/lib/tests/api.interceptor.spec.ts
  3. 2
      npm/ng-packs/packages/core/src/lib/tests/application-configuration.service.spec.ts
  4. 6
      npm/ng-packs/packages/core/src/lib/tests/auth.guard.spec.ts
  5. 2
      npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts
  6. 6
      npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts
  7. 4
      npm/ng-packs/packages/core/src/lib/tests/dynamic-layout.component.spec.ts
  8. 6
      npm/ng-packs/packages/core/src/lib/tests/locale.provider.spec.ts
  9. 4
      npm/ng-packs/packages/core/src/lib/tests/localization.pipe.spec.ts
  10. 4
      npm/ng-packs/packages/core/src/lib/tests/localization.service.spec.ts
  11. 2
      npm/ng-packs/packages/core/src/lib/tests/permission.directive.spec.ts
  12. 2
      npm/ng-packs/packages/core/src/lib/tests/permission.guard.spec.ts
  13. 2
      npm/ng-packs/packages/core/src/lib/tests/profile-state.service.spec.ts
  14. 6
      npm/ng-packs/packages/core/src/lib/tests/profile.service.spec.ts
  15. 2
      npm/ng-packs/packages/core/src/lib/tests/profile.state.spec.ts
  16. 6
      npm/ng-packs/packages/core/src/lib/tests/replaceable-components.state.spec.ts
  17. 2
      npm/ng-packs/packages/core/src/lib/tests/rest.service.spec.ts
  18. 2
      npm/ng-packs/packages/core/src/lib/tests/session-state.service.spec.ts
  19. 2
      npm/ng-packs/packages/feature-management/src/lib/tests/feature-management-state.service.spec.ts
  20. 2
      npm/ng-packs/packages/identity/src/lib/tests/identity-state.service.spec.ts
  21. 2
      npm/ng-packs/packages/permission-management/src/lib/tests/permission-management-state.service.spec.ts
  22. 2
      npm/ng-packs/packages/tenant-management/src/lib/tests/tenant-management-state.service.spec.ts
  23. 4
      npm/ng-packs/packages/theme-shared/extensions/src/tests/form-props.util.spec.ts
  24. 6
      npm/ng-packs/packages/theme-shared/src/lib/tests/append-content.token.spec.ts
  25. 4
      npm/ng-packs/packages/theme-shared/src/lib/tests/breadcrumb.component.spec.ts
  26. 6
      npm/ng-packs/packages/theme-shared/src/lib/tests/error.handler.spec.ts
  27. 8
      npm/ng-packs/packages/theme-shared/src/lib/tests/loader-bar.component.spec.ts
  28. 2
      npm/ng-packs/packages/theme-shared/src/lib/tests/modal-container.component.spec.ts
  29. 4
      npm/ng-packs/packages/theme-shared/src/lib/tests/modal.component.spec.ts
  30. 2
      npm/ng-packs/packages/theme-shared/src/lib/tests/validation-utils.spec.ts
  31. 9
      npm/ng-packs/yarn.lock

4
npm/ng-packs/packages/account/src/lib/tests/account.service.spec.ts

@ -15,7 +15,7 @@ describe('AccountService', () => {
beforeEach(() => (spectator = createHttp())); beforeEach(() => (spectator = createHttp()));
it('should send a GET to find tenant', () => { it('should send a GET to find tenant', () => {
spectator.get(Store).selectSnapshot.andReturn('https://abp.io'); spectator.inject(Store).selectSnapshot.andReturn('https://abp.io');
spectator.service.findTenant('test').subscribe(); spectator.service.findTenant('test').subscribe();
spectator.expectOne( spectator.expectOne(
'https://abp.io/api/abp/multi-tenancy/tenants/by-name/test', 'https://abp.io/api/abp/multi-tenancy/tenants/by-name/test',
@ -30,7 +30,7 @@ describe('AccountService', () => {
password: 'test1234', password: 'test1234',
appName: 'Angular', appName: 'Angular',
} as RegisterRequest; } as RegisterRequest;
spectator.get(Store).selectSnapshot.andReturn('https://abp.io'); spectator.inject(Store).selectSnapshot.andReturn('https://abp.io');
spectator.service.register(mock).subscribe(); spectator.service.register(mock).subscribe();
const req = spectator.expectOne('https://abp.io/api/account/register', HttpMethod.POST); const req = spectator.expectOne('https://abp.io/api/account/register', HttpMethod.POST);
expect(req.request.body).toEqual(mock); expect(req.request.body).toEqual(mock);

4
npm/ng-packs/packages/core/src/lib/tests/api.interceptor.spec.ts

@ -21,8 +21,8 @@ describe('ApiInterceptor', () => {
beforeEach(() => { beforeEach(() => {
spectator = createService(); spectator = createService();
interceptor = spectator.service; interceptor = spectator.service;
store = spectator.get(Store); store = spectator.inject(Store);
oauthService = spectator.get(OAuthService); oauthService = spectator.inject(OAuthService);
}); });
it('should add headers to http request', done => { it('should add headers to http request', done => {

2
npm/ng-packs/packages/core/src/lib/tests/application-configuration.service.spec.ts

@ -14,7 +14,7 @@ describe('ApplicationConfigurationService', () => {
beforeEach(() => (spectator = createHttp())); beforeEach(() => (spectator = createHttp()));
it('should send a GET to application-configuration API', () => { it('should send a GET to application-configuration API', () => {
spectator.get(Store).selectSnapshot.andReturn('https://abp.io'); spectator.inject(Store).selectSnapshot.andReturn('https://abp.io');
spectator.service.getConfiguration().subscribe(); spectator.service.getConfiguration().subscribe();
spectator.expectOne('https://abp.io/api/abp/application-configuration', HttpMethod.GET); spectator.expectOne('https://abp.io/api/abp/application-configuration', HttpMethod.GET);
}); });

6
npm/ng-packs/packages/core/src/lib/tests/auth.guard.spec.ts

@ -22,13 +22,13 @@ describe('AuthGuard', () => {
}); });
it('should return true when user logged in', () => { it('should return true when user logged in', () => {
spectator.get(OAuthService).hasValidAccessToken.andReturn(true); spectator.inject(OAuthService).hasValidAccessToken.andReturn(true);
expect(guard.canActivate(null, null)).toBe(true); expect(guard.canActivate(null, null)).toBe(true);
}); });
it('should return navigate to login page with redirectUrl state', () => { it('should return navigate to login page with redirectUrl state', () => {
const router = spectator.get(Router); const router = spectator.inject(Router);
spectator.get(OAuthService).hasValidAccessToken.andReturn(false); spectator.inject(OAuthService).hasValidAccessToken.andReturn(false);
expect(guard.canActivate(null, { url: '/' } as any)).toBe(true); expect(guard.canActivate(null, { url: '/' } as any)).toBe(true);
expect(router.navigate).toHaveBeenCalledWith(['/account/login'], { expect(router.navigate).toHaveBeenCalledWith(['/account/login'], {

2
npm/ng-packs/packages/core/src/lib/tests/config-state.service.spec.ts

@ -102,7 +102,7 @@ describe('ConfigStateService', () => {
beforeEach(() => { beforeEach(() => {
spectator = createService(); spectator = createService();
service = spectator.service; service = spectator.service;
store = spectator.get(Store); store = spectator.inject(Store);
}); });
test('should have the all ConfigState static methods', () => { test('should have the all ConfigState static methods', () => {
const reg = /(?<=static )(.*)(?=\()/gm; const reg = /(?<=static )(.*)(?=\()/gm;

6
npm/ng-packs/packages/core/src/lib/tests/config.state.spec.ts

@ -110,9 +110,9 @@ describe('ConfigState', () => {
beforeEach(() => { beforeEach(() => {
spectator = createService(); spectator = createService();
store = spectator.get(Store); store = spectator.inject(Store);
service = spectator.service; service = spectator.service;
state = new ConfigState(spectator.get(HttpClient), store); state = new ConfigState(spectator.inject(HttpClient), store);
}); });
describe('#getAll', () => { describe('#getAll', () => {
@ -250,7 +250,7 @@ describe('ConfigState', () => {
dispatchArg = a; dispatchArg = a;
return of(a); return of(a);
}); });
const httpClient = spectator.get(HttpClient); const httpClient = spectator.inject(HttpClient);
httpClient.get.andReturn(res$); httpClient.get.andReturn(res$);
state.addData({ patchState, dispatch } as any).subscribe(); state.addData({ patchState, dispatch } as any).subscribe();

4
npm/ng-packs/packages/core/src/lib/tests/dynamic-layout.component.spec.ts

@ -167,8 +167,8 @@ describe('DynamicLayoutComponent', () => {
beforeEach(async () => { beforeEach(async () => {
spectator = createComponent(); spectator = createComponent();
store = spectator.get(Store); store = spectator.inject(Store);
const routesService = spectator.get(RoutesService); const routesService = spectator.inject(RoutesService);
routesService.add(routes); routesService.add(routes);
store.reset(storeData); store.reset(storeData);

6
npm/ng-packs/packages/core/src/lib/tests/locale.provider.spec.ts

@ -26,12 +26,12 @@ describe('LocaleProvider', () => {
describe('#LOCALE_ID', () => { describe('#LOCALE_ID', () => {
test('should equal to currentLang', async () => { test('should equal to currentLang', async () => {
spectator = createComponent(); spectator = createComponent();
const localizationService = spectator.get(LocalizationService); const localizationService = spectator.inject(LocalizationService);
expect(spectator.get(LOCALE_ID).valueOf()).toBe(localesMapping['en-US'] || 'en-US'); expect(spectator.inject(LOCALE_ID).valueOf()).toBe(localesMapping['en-US'] || 'en-US');
(localizationService as any).currentLang = 'tr'; (localizationService as any).currentLang = 'tr';
expect(spectator.get(LOCALE_ID).valueOf()).toBe(localesMapping['tr'] || 'tr'); expect(spectator.inject(LOCALE_ID).valueOf()).toBe(localesMapping['tr'] || 'tr');
}); });
}); });
}); });

4
npm/ng-packs/packages/core/src/lib/tests/localization.pipe.spec.ts

@ -12,8 +12,8 @@ describe('LocalizationPipe', () => {
beforeEach(() => { beforeEach(() => {
spectator = createService(); spectator = createService();
pipe = spectator.get(LocalizationPipe); pipe = spectator.inject(LocalizationPipe);
store = spectator.get(Store); store = spectator.inject(Store);
}); });
it('should call getLocalization selector', () => { it('should call getLocalization selector', () => {

4
npm/ng-packs/packages/core/src/lib/tests/localization.service.spec.ts

@ -18,7 +18,7 @@ describe('LocalizationService', () => {
beforeEach(() => { beforeEach(() => {
spectator = createService(); spectator = createService();
store = spectator.get(Store); store = spectator.inject(Store);
service = spectator.service; service = spectator.service;
}); });
@ -52,7 +52,7 @@ describe('LocalizationService', () => {
describe('#registerLocale', () => { describe('#registerLocale', () => {
it('should return registerLocale and then call setRouteReuse', () => { it('should return registerLocale and then call setRouteReuse', () => {
const router = spectator.get(Router); const router = spectator.inject(Router);
const shouldReuseRoute = () => true; const shouldReuseRoute = () => true;
router.routeReuseStrategy = { shouldReuseRoute } as any; router.routeReuseStrategy = { shouldReuseRoute } as any;

2
npm/ng-packs/packages/core/src/lib/tests/permission.directive.spec.ts

@ -42,7 +42,7 @@ describe('PermissionDirective', () => {
}); });
it('should do nothing when condition is undefined', () => { it('should do nothing when condition is undefined', () => {
const spy = jest.spyOn(spectator.get(Store), 'select'); const spy = jest.spyOn(spectator.inject(Store), 'select');
grantedPolicy$.next(false); grantedPolicy$.next(false);
expect(spy.mock.calls).toHaveLength(0); expect(spy.mock.calls).toHaveLength(0);
}); });

2
npm/ng-packs/packages/core/src/lib/tests/permission.guard.spec.ts

@ -52,7 +52,7 @@ describe('PermissionGuard', () => {
spectator = createService(); spectator = createService();
guard = spectator.service; guard = spectator.service;
routes = spectator.inject(RoutesService); routes = spectator.inject(RoutesService);
store = spectator.get(Store); store = spectator.inject(Store);
}); });
it('should return true when the grantedPolicy is true', done => { it('should return true when the grantedPolicy is true', done => {

2
npm/ng-packs/packages/core/src/lib/tests/profile-state.service.spec.ts

@ -13,7 +13,7 @@ describe('ProfileStateService', () => {
beforeEach(() => { beforeEach(() => {
spectator = createService(); spectator = createService();
service = spectator.service; service = spectator.service;
store = spectator.get(Store); store = spectator.inject(Store);
}); });
test('should have the all ProfileState static methods', () => { test('should have the all ProfileState static methods', () => {
const reg = /(?<=static )(.*)(?=\()/gm; const reg = /(?<=static )(.*)(?=\()/gm;

6
npm/ng-packs/packages/core/src/lib/tests/profile.service.spec.ts

@ -14,14 +14,14 @@ describe('ProfileService', () => {
beforeEach(() => (spectator = createHttp())); beforeEach(() => (spectator = createHttp()));
it('should send a GET to my-profile API', () => { it('should send a GET to my-profile API', () => {
spectator.get(Store).selectSnapshot.andReturn('https://abp.io'); spectator.inject(Store).selectSnapshot.andReturn('https://abp.io');
spectator.service.get().subscribe(); spectator.service.get().subscribe();
spectator.expectOne('https://abp.io/api/identity/my-profile', HttpMethod.GET); spectator.expectOne('https://abp.io/api/identity/my-profile', HttpMethod.GET);
}); });
it('should send a POST to change-password API', () => { it('should send a POST to change-password API', () => {
const mock = { currentPassword: 'test', newPassword: 'test' }; const mock = { currentPassword: 'test', newPassword: 'test' };
spectator.get(Store).selectSnapshot.andReturn('https://abp.io'); spectator.inject(Store).selectSnapshot.andReturn('https://abp.io');
spectator.service.changePassword(mock).subscribe(); spectator.service.changePassword(mock).subscribe();
const req = spectator.expectOne( const req = spectator.expectOne(
'https://abp.io/api/identity/my-profile/change-password', 'https://abp.io/api/identity/my-profile/change-password',
@ -38,7 +38,7 @@ describe('ProfileService', () => {
surname: 'Doe', surname: 'Doe',
phoneNumber: '+123456', phoneNumber: '+123456',
}; };
spectator.get(Store).selectSnapshot.andReturn('https://abp.io'); spectator.inject(Store).selectSnapshot.andReturn('https://abp.io');
spectator.service.update(mock).subscribe(); spectator.service.update(mock).subscribe();
const req = spectator.expectOne('https://abp.io/api/identity/my-profile', HttpMethod.PUT); const req = spectator.expectOne('https://abp.io/api/identity/my-profile', HttpMethod.PUT);
expect(req.request.body).toEqual(mock); expect(req.request.body).toEqual(mock);

2
npm/ng-packs/packages/core/src/lib/tests/profile.state.spec.ts

@ -26,7 +26,7 @@ describe('ProfileState', () => {
beforeEach(() => { beforeEach(() => {
spectator = createService(); spectator = createService();
profileService = spectator.get(ProfileService); profileService = spectator.inject(ProfileService);
state = new ProfileState(profileService); state = new ProfileState(profileService);
}); });

6
npm/ng-packs/packages/core/src/lib/tests/replaceable-components.state.spec.ts

@ -25,7 +25,7 @@ describe('ReplaceableComponentsState', () => {
}); });
it('should add a component to the state', () => { it('should add a component to the state', () => {
const store = spectator.get(Store); const store = spectator.inject(Store);
expect(store.selectSnapshot(ReplaceableComponentsState.getAll)).toEqual([]); expect(store.selectSnapshot(ReplaceableComponentsState.getAll)).toEqual([]);
store.dispatch(new AddReplaceableComponent({ component: DummyComponent, key: 'Dummy' })); store.dispatch(new AddReplaceableComponent({ component: DummyComponent, key: 'Dummy' }));
expect(store.selectSnapshot(ReplaceableComponentsState.getComponent('Dummy'))).toEqual({ expect(store.selectSnapshot(ReplaceableComponentsState.getComponent('Dummy'))).toEqual({
@ -35,7 +35,7 @@ describe('ReplaceableComponentsState', () => {
}); });
it('should replace a exist component', () => { it('should replace a exist component', () => {
const store = spectator.get(Store); const store = spectator.inject(Store);
store.dispatch(new AddReplaceableComponent({ component: DummyComponent, key: 'Dummy' })); store.dispatch(new AddReplaceableComponent({ component: DummyComponent, key: 'Dummy' }));
store.dispatch(new AddReplaceableComponent({ component: null, key: 'Dummy' })); store.dispatch(new AddReplaceableComponent({ component: null, key: 'Dummy' }));
expect(store.selectSnapshot(ReplaceableComponentsState.getComponent('Dummy'))).toEqual({ expect(store.selectSnapshot(ReplaceableComponentsState.getComponent('Dummy'))).toEqual({
@ -47,7 +47,7 @@ describe('ReplaceableComponentsState', () => {
it('should call reloadRoute when reload parameter is given as true to AddReplaceableComponent', async () => { it('should call reloadRoute when reload parameter is given as true to AddReplaceableComponent', async () => {
const spy = jest.spyOn(router, 'navigateByUrl'); const spy = jest.spyOn(router, 'navigateByUrl');
const store = spectator.get(Store); const store = spectator.inject(Store);
store.dispatch(new AddReplaceableComponent({ component: DummyComponent, key: 'Dummy' })); store.dispatch(new AddReplaceableComponent({ component: DummyComponent, key: 'Dummy' }));
store.dispatch(new AddReplaceableComponent({ component: null, key: 'Dummy' }, true)); store.dispatch(new AddReplaceableComponent({ component: null, key: 'Dummy' }, true));

2
npm/ng-packs/packages/core/src/lib/tests/rest.service.spec.ts

@ -20,7 +20,7 @@ describe('HttpClient testing', () => {
beforeEach(() => { beforeEach(() => {
spectator = createHttp(); spectator = createHttp();
store = spectator.get(Store); store = spectator.inject(Store);
store.reset({ store.reset({
ConfigState: { ConfigState: {
environment: { environment: {

2
npm/ng-packs/packages/core/src/lib/tests/session-state.service.spec.ts

@ -17,7 +17,7 @@ describe('SessionStateService', () => {
beforeEach(() => { beforeEach(() => {
spectator = createService(); spectator = createService();
service = spectator.service; service = spectator.service;
store = spectator.get(Store); store = spectator.inject(Store);
}); });
test('should have the all SessionState static methods', () => { test('should have the all SessionState static methods', () => {
const reg = /(?<=static )(.*)(?=\()/gm; const reg = /(?<=static )(.*)(?=\()/gm;

2
npm/ng-packs/packages/feature-management/src/lib/tests/feature-management-state.service.spec.ts

@ -16,7 +16,7 @@ describe('FeatureManagementStateService', () => {
beforeEach(() => { beforeEach(() => {
spectator = createService(); spectator = createService();
service = spectator.service; service = spectator.service;
store = spectator.get(Store); store = spectator.inject(Store);
}); });
test('should have the all FeatureManagementState static methods', () => { test('should have the all FeatureManagementState static methods', () => {

2
npm/ng-packs/packages/identity/src/lib/tests/identity-state.service.spec.ts

@ -13,7 +13,7 @@ describe('IdentityStateService', () => {
beforeEach(() => { beforeEach(() => {
spectator = createService(); spectator = createService();
service = spectator.service; service = spectator.service;
store = spectator.get(Store); store = spectator.inject(Store);
}); });
test('should have the all IdentityState static methods', () => { test('should have the all IdentityState static methods', () => {

2
npm/ng-packs/packages/permission-management/src/lib/tests/permission-management-state.service.spec.ts

@ -16,7 +16,7 @@ describe('PermissionManagementStateService', () => {
beforeEach(() => { beforeEach(() => {
spectator = createService(); spectator = createService();
service = spectator.service; service = spectator.service;
store = spectator.get(Store); store = spectator.inject(Store);
}); });
test('should have the all PermissionManagementState static methods', () => { test('should have the all PermissionManagementState static methods', () => {
const reg = /(?<=static )(.*)(?=\()/gm; const reg = /(?<=static )(.*)(?=\()/gm;

2
npm/ng-packs/packages/tenant-management/src/lib/tests/tenant-management-state.service.spec.ts

@ -16,7 +16,7 @@ describe('TenantManagementStateService', () => {
beforeEach(() => { beforeEach(() => {
spectator = createService(); spectator = createService();
service = spectator.service; service = spectator.service;
store = spectator.get(Store); store = spectator.inject(Store);
}); });
test('should have the all TenantManagementState static methods', () => { test('should have the all TenantManagementState static methods', () => {

4
npm/ng-packs/packages/theme-shared/extensions/src/tests/form-props.util.spec.ts

@ -126,8 +126,8 @@ describe('Form Prop Utils', () => {
function* getInjected(spectator: SpectatorService<ExtensionsService>) { function* getInjected(spectator: SpectatorService<ExtensionsService>) {
yield spectator.service; yield spectator.service;
yield spectator.get(EXTENSIONS_IDENTIFIER); yield spectator.inject(EXTENSIONS_IDENTIFIER);
yield spectator.get(LocalizationService); yield spectator.inject(LocalizationService);
} }
interface Foo { interface Foo {

6
npm/ng-packs/packages/theme-shared/src/lib/tests/append-content.token.spec.ts

@ -15,8 +15,8 @@ describe('AppendContentToken', () => {
beforeEach(() => (spectator = createComponent())); beforeEach(() => (spectator = createComponent()));
it('should insert a style element to the DOM', () => { it('should insert a style element to the DOM', () => {
spectator.get(THEME_SHARED_APPEND_CONTENT); spectator.inject(THEME_SHARED_APPEND_CONTENT);
expect(spectator.get(DomInsertionService).has(styles)).toBe(true); expect(spectator.inject(DomInsertionService).has(styles)).toBe(true);
}); });
it('should be loaded the chart.js', done => { it('should be loaded the chart.js', done => {
@ -25,6 +25,6 @@ describe('AppendContentToken', () => {
done(); done();
}); });
spectator.get(THEME_SHARED_APPEND_CONTENT); spectator.inject(THEME_SHARED_APPEND_CONTENT);
}); });
}); });

4
npm/ng-packs/packages/theme-shared/src/lib/tests/breadcrumb.component.spec.ts

@ -54,8 +54,8 @@ describe('BreadcrumbComponent', () => {
beforeEach(() => { beforeEach(() => {
spectator = createRouting(); spectator = createRouting();
routes = spectator.get(RoutesService); routes = spectator.inject(RoutesService);
store = spectator.get(Store); store = spectator.inject(Store);
}); });
it('should display the breadcrumb', async () => { it('should display the breadcrumb', async () => {

6
npm/ng-packs/packages/theme-shared/src/lib/tests/error.handler.spec.ts

@ -52,7 +52,7 @@ describe('ErrorHandler', () => {
beforeEach(() => { beforeEach(() => {
spectator = createService(); spectator = createService();
service = spectator.service; service = spectator.service;
store = spectator.get(Store); store = spectator.inject(Store);
store.selectSnapshot = jest.fn(() => '/x'); store.selectSnapshot = jest.fn(() => '/x');
}); });
@ -189,7 +189,7 @@ describe('ErrorHandler', () => {
test('should call error method of ConfirmationService when authenticated error occurs with _AbpErrorFormat header', done => { test('should call error method of ConfirmationService when authenticated error occurs with _AbpErrorFormat header', done => {
spectator spectator
.get(Actions) .inject(Actions)
.pipe(ofActionDispatched(Navigate)) .pipe(ofActionDispatched(Navigate))
.subscribe(({ path, queryParams, extras }) => { .subscribe(({ path, queryParams, extras }) => {
expect(path).toEqual(['/account/login']); expect(path).toEqual(['/account/login']);
@ -281,7 +281,7 @@ describe('ErrorHandler with custom error component', () => {
beforeEach(() => { beforeEach(() => {
spectator = createService(); spectator = createService();
service = spectator.service; service = spectator.service;
store = spectator.get(Store); store = spectator.inject(Store);
store.selectSnapshot = jest.fn(() => '/x'); store.selectSnapshot = jest.fn(() => '/x');
}); });

8
npm/ng-packs/packages/theme-shared/src/lib/tests/loader-bar.component.spec.ts

@ -22,7 +22,7 @@ describe('LoaderBarComponent', () => {
spectator = createHost('<abp-loader-bar></abp-loader-bar>'); spectator = createHost('<abp-loader-bar></abp-loader-bar>');
spectator.component.intervalPeriod = 1; spectator.component.intervalPeriod = 1;
spectator.component.stopDelay = 1; spectator.component.stopDelay = 1;
router = spectator.get(Router); router = spectator.inject(Router);
(router as any).events = events$; (router as any).events = events$;
}); });
@ -34,7 +34,7 @@ describe('LoaderBarComponent', () => {
it('should increase the progressLevel', done => { it('should increase the progressLevel', done => {
spectator.detectChanges(); spectator.detectChanges();
spectator.get(Store).dispatch(new StartLoader(new HttpRequest('GET', 'test'))); spectator.inject(Store).dispatch(new StartLoader(new HttpRequest('GET', 'test')));
spectator.detectChanges(); spectator.detectChanges();
setTimeout(() => { setTimeout(() => {
expect(spectator.component.progressLevel > 0).toBeTruthy(); expect(spectator.component.progressLevel > 0).toBeTruthy();
@ -44,7 +44,7 @@ describe('LoaderBarComponent', () => {
test.skip('should be interval unsubscribed', done => { test.skip('should be interval unsubscribed', done => {
spectator.detectChanges(); spectator.detectChanges();
spectator.get(Store).dispatch(new StartLoader(new HttpRequest('GET', 'test'))); spectator.inject(Store).dispatch(new StartLoader(new HttpRequest('GET', 'test')));
expect(spectator.component.interval.closed).toBe(false); expect(spectator.component.interval.closed).toBe(false);
timer(400).subscribe(() => { timer(400).subscribe(() => {
@ -73,7 +73,7 @@ describe('LoaderBarComponent', () => {
(router as any).events.next(new NavigationStart(1, 'test')); (router as any).events.next(new NavigationStart(1, 'test'));
expect(spectator.component.interval.closed).toBe(false); expect(spectator.component.interval.closed).toBe(false);
spectator.get(Store).dispatch(new StopLoader(new HttpRequest('GET', 'test'))); spectator.inject(Store).dispatch(new StopLoader(new HttpRequest('GET', 'test')));
expect(spectator.component.progressLevel).toBe(100); expect(spectator.component.progressLevel).toBe(100);
timer(2).subscribe(() => { timer(2).subscribe(() => {

2
npm/ng-packs/packages/theme-shared/src/lib/tests/modal-container.component.spec.ts

@ -23,7 +23,7 @@ describe('ModalContainerComponent', () => {
let foo = document.querySelector('div.foo'); let foo = document.querySelector('div.foo');
expect(foo).toBeNull(); expect(foo).toBeNull();
const cfResolver = spectator.get(ComponentFactoryResolver); const cfResolver = spectator.inject(ComponentFactoryResolver);
const factory = cfResolver.resolveComponentFactory(TestComponent); const factory = cfResolver.resolveComponentFactory(TestComponent);
componentRef = spectator.component.container.createComponent(factory); componentRef = spectator.component.container.createComponent(factory);

4
npm/ng-packs/packages/theme-shared/src/lib/tests/modal.component.spec.ts

@ -78,7 +78,7 @@ describe('ModalComponent', () => {
}); });
afterEach(() => { afterEach(() => {
const modalService = spectator.get(ModalService); const modalService = spectator.inject(ModalService);
modalService.clearModal(); modalService.clearModal();
}); });
@ -120,7 +120,7 @@ describe('ModalComponent', () => {
}); });
it('should open the confirmation popup and works correct', async () => { it('should open the confirmation popup and works correct', async () => {
const confirmationService = spectator.get(ConfirmationService); const confirmationService = spectator.inject(ConfirmationService);
const warnSpy = jest.spyOn(confirmationService, 'warn'); const warnSpy = jest.spyOn(confirmationService, 'warn');
await wait0ms(); await wait0ms();

2
npm/ng-packs/packages/theme-shared/src/lib/tests/validation-utils.spec.ts

@ -22,7 +22,7 @@ describe('ValidationUtils', () => {
describe('#getPasswordValidators', () => { describe('#getPasswordValidators', () => {
it('should return password valdiators', () => { it('should return password valdiators', () => {
const store = spectator.get(Store); const store = spectator.inject(Store);
store.reset({ store.reset({
ConfigState: { ConfigState: {
setting: { setting: {

9
npm/ng-packs/yarn.lock

@ -2319,13 +2319,20 @@
rxjs "6.5.5" rxjs "6.5.5"
webpack-sources "1.4.3" webpack-sources "1.4.3"
"@ngx-validate/core@^0.0.8", "@ngx-validate/core@^0.0.9": "@ngx-validate/core@^0.0.8":
version "0.0.8" version "0.0.8"
resolved "https://registry.yarnpkg.com/@ngx-validate/core/-/core-0.0.8.tgz#8577405eb1af0f5002cdda7a86fbcda56280f116" resolved "https://registry.yarnpkg.com/@ngx-validate/core/-/core-0.0.8.tgz#8577405eb1af0f5002cdda7a86fbcda56280f116"
integrity sha512-caIG5ao76Xhf7T+pNA8crnpAwK0yqj3i0OAUGZRUq1W+kNgz+ZnrSd4F9an/W4g+38u/8gfUVvsfsm07ju6qYA== integrity sha512-caIG5ao76Xhf7T+pNA8crnpAwK0yqj3i0OAUGZRUq1W+kNgz+ZnrSd4F9an/W4g+38u/8gfUVvsfsm07ju6qYA==
dependencies: dependencies:
tslib "^1.9.0" tslib "^1.9.0"
"@ngx-validate/core@^0.0.9":
version "0.0.9"
resolved "https://registry.yarnpkg.com/@ngx-validate/core/-/core-0.0.9.tgz#c5baea9e6f2f28c70d1adaf1edde5a9bcc8929c0"
integrity sha512-bvgwGr3l47gyxqsfKkI8c7UNMlv8ct/OvwYVDjYI7GBt0A+nhBb+xFmirWbBkMT64bUI0Y8pWIiB5qiewPG1WA==
dependencies:
tslib "^1.9.0"
"@ngxs/devtools-plugin@^3.6.2": "@ngxs/devtools-plugin@^3.6.2":
version "3.6.2" version "3.6.2"
resolved "https://registry.yarnpkg.com/@ngxs/devtools-plugin/-/devtools-plugin-3.6.2.tgz#aa0a4835f90fb905951d7712dc3ce508cbc15a2c" resolved "https://registry.yarnpkg.com/@ngxs/devtools-plugin/-/devtools-plugin-3.6.2.tgz#aa0a4835f90fb905951d7712dc3ce508cbc15a2c"

Loading…
Cancel
Save