Skip to content

Commit

Permalink
[DSC-1451] Fix error with test
Browse files Browse the repository at this point in the history
  • Loading branch information
atarix83 committed Sep 13, 2024
1 parent 23a5229 commit f306287
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions src/app/shared/loading/loading.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';

import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
import {
ComponentFixture,
TestBed,
waitForAsync,
} from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { RouterTestingModule } from '@angular/router/testing';
import {
TranslateLoader,
TranslateModule,
} from '@ngx-translate/core';

import { TranslateLoaderMock } from '../mocks/translate-loader.mock';

import { LoadingComponent } from './loading.component';
import { Router } from '@angular/router';
import { RouterMock } from '../mocks/router.mock';

describe('LoadingComponent (inline template)', () => {

Expand All @@ -20,18 +24,20 @@ describe('LoadingComponent (inline template)', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule.withRoutes([
{
path: 'fake-url',
redirectTo: '/',
},
]),
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useClass: TranslateLoaderMock
}
useClass: TranslateLoaderMock,
},
}),
],
declarations: [LoadingComponent], // declare the test component
providers: [
TranslateService,
{provide: Router, useValue: new RouterMock()},
]
}).compileComponents(); // compile template and css

}));
Expand Down

0 comments on commit f306287

Please sign in to comment.