|
1 |
| -import { HttpClientTestingModule } from "@angular/common/http/testing"; |
| 1 | +import { provideHttpClient } from "@angular/common/http"; |
| 2 | +import { provideHttpClientTesting } from "@angular/common/http/testing"; |
2 | 3 | import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from "@angular/core";
|
3 |
| -import { TestBed, waitForAsync } from "@angular/core/testing"; |
4 |
| - |
5 |
| -import { RouterTestingModule } from "@angular/router/testing"; |
| 4 | +import { TestBed } from "@angular/core/testing"; |
6 | 5 |
|
7 | 6 | import { AppComponent } from "./app.component";
|
8 | 7 | import { MATOMO_INJECTORS } from "./shared";
|
| 8 | +import { RouterModule } from "@angular/router"; |
| 9 | +import { UsagerAuthService } from "./modules/usager-auth/services/usager-auth.service"; |
9 | 10 |
|
10 | 11 | describe("AppComponent", () => {
|
11 |
| - beforeEach(waitForAsync(() => { |
| 12 | + beforeEach(() => { |
12 | 13 | TestBed.configureTestingModule({
|
13 | 14 | declarations: [AppComponent],
|
14 |
| - imports: [ |
15 |
| - HttpClientTestingModule, |
16 |
| - ...MATOMO_INJECTORS, |
17 |
| - RouterTestingModule, |
| 15 | + imports: [...MATOMO_INJECTORS, RouterModule.forRoot([])], |
| 16 | + providers: [ |
| 17 | + UsagerAuthService, |
| 18 | + provideHttpClient(), |
| 19 | + provideHttpClientTesting(), |
18 | 20 | ],
|
19 | 21 | schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
|
20 | 22 | }).compileComponents();
|
21 |
| - })); |
| 23 | + }); |
22 | 24 |
|
23 | 25 | it("should create the app", () => {
|
24 | 26 | const fixture = TestBed.createComponent(AppComponent);
|
|
0 commit comments