diff --git a/lib/core/src/lib/auth/services/authentication.service.spec.ts b/lib/core/src/lib/auth/services/authentication.service.spec.ts index ae0ae798514..1454af9c027 100644 --- a/lib/core/src/lib/auth/services/authentication.service.spec.ts +++ b/lib/core/src/lib/auth/services/authentication.service.spec.ts @@ -19,9 +19,13 @@ import { fakeAsync, TestBed } from '@angular/core/testing'; import { AuthenticationService } from './authentication.service'; import { CookieService } from '../../common/services/cookie.service'; import { AppConfigService } from '../../app-config/app-config.service'; -import { setupTestBed } from '../../testing/setup-test-bed'; -import { CoreTestingModule } from '../../testing/core.testing.module'; +import { TranslateModule } from '@ngx-translate/core'; import { BasicAlfrescoAuthService } from '../basic-auth/basic-alfresco-auth.service'; +import { OidcAuthenticationService } from './oidc-authentication.service'; +import { AuthModule } from '../oidc/auth.module'; +import { HttpClientModule } from '@angular/common/http'; +import { CookieServiceMock } from '../../mock'; +import { AppConfigServiceMock } from '../../common'; import { OidcAuthenticationService } from '../oidc/oidc-authentication.service'; import { OAuthEvent } from 'angular-oauth2-oidc'; import { Subject } from 'rxjs'; @@ -29,19 +33,33 @@ import { RedirectAuthService } from '../oidc/redirect-auth.service'; import { Injector } from '@angular/core'; declare let jasmine: any; -// eslint-disable-next-line -xdescribe('AuthenticationService', () => { + +describe('AuthenticationService', () => { let authService: AuthenticationService; let basicAlfrescoAuthService: BasicAlfrescoAuthService; let appConfigService: AppConfigService; let cookie: CookieService; let oidcAuthenticationService: OidcAuthenticationService; - setupTestBed({ - imports: [CoreTestingModule] - }); - beforeEach(() => { + TestBed.configureTestingModule({ + imports: [ + TranslateModule.forRoot(), + AuthModule.forRoot({ useHash: true }), + HttpClientModule + ], + providers: [ + { + provide: CookieService, + useClass: CookieServiceMock + }, + { + provide: AppConfigService, + useClass: AppConfigServiceMock + } + ] + }); + sessionStorage.clear(); localStorage.clear(); authService = TestBed.inject(AuthenticationService);