Skip to content

Commit

Permalink
[AAE-18267] change unit test setup for auth service (#9216)
Browse files Browse the repository at this point in the history
* [AAE-18267] change unit test setup for auth service

* [AAE-18267] remove exclude

* [AAE-18267] removed CoreTestingModule from imports
  • Loading branch information
wojd0 authored and VitoAlbano committed Jun 15, 2024
1 parent 3d8cd67 commit 5b90085
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions lib/core/src/lib/auth/services/authentication.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,43 @@ 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';

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);
Expand Down

0 comments on commit 5b90085

Please sign in to comment.