import { Routes } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
+import { NgbAlertModule } from '@ng-bootstrap/ng-bootstrap';
import { of as observableOf } from 'rxjs';
-import { AlertModule } from 'ngx-bootstrap/alert';
-
-import { configureTestBed } from '../../../../testing/unit-test-helper';
-
-import { SettingsService } from '../../api/settings.service';
-import { AuthStorageService } from '../../services/auth-storage.service';
+import { SettingsService } from '~/app/shared/api/settings.service';
+import { AuthStorageService } from '~/app/shared/services/auth-storage.service';
+import { configureTestBed } from '~/testing/unit-test-helper';
import { PwdExpirationNotificationComponent } from './pwd-expiration-notification.component';
describe('PwdExpirationNotificationComponent', () => {
configureTestBed({
declarations: [PwdExpirationNotificationComponent, FakeComponent],
- imports: [
- AlertModule.forRoot(),
- HttpClientTestingModule,
- RouterTestingModule.withRoutes(routes)
- ],
+ imports: [NgbAlertModule, HttpClientTestingModule, RouterTestingModule.withRoutes(routes)],
providers: [SettingsService, AuthStorageService]
});
describe('password expiration date has been set', () => {
beforeEach(() => {
- authStorageService = TestBed.get(AuthStorageService);
- settingsService = TestBed.get(SettingsService);
+ authStorageService = TestBed.inject(AuthStorageService);
+ settingsService = TestBed.inject(SettingsService);
spyOn(authStorageService, 'getPwdExpirationDate').and.returnValue(1645488000);
spyOn(settingsService, 'getStandardSettings').and.returnValue(
observableOf({
describe('password expiration date has not been set', () => {
beforeEach(() => {
- authStorageService = TestBed.get(AuthStorageService);
+ authStorageService = TestBed.inject(AuthStorageService);
spyOn(authStorageService, 'getPwdExpirationDate').and.returnValue(null);
fixture = TestBed.createComponent(PwdExpirationNotificationComponent);
component = fixture.componentInstance;