Skip to content

Commit

Permalink
Make sure ngOnInit is called
Browse files Browse the repository at this point in the history
  • Loading branch information
minottic committed Sep 25, 2024
1 parent 327dba5 commit df08654
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TestBed, waitForAsync } from "@angular/core/testing";
import { fakeAsync, TestBed, waitForAsync } from "@angular/core/testing";
import { RouterTestingModule } from "@angular/router/testing";
import { AppComponent } from "./app.component";
import { APP_CONFIG } from "./app-config.module";
Expand Down Expand Up @@ -35,17 +35,14 @@ describe("AppComponent", () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual("ESS Public Data Repository test");
expect(app.config.scicatBaseUrl).toEqual("https://scicat.esss.se");
expect(app.config.lbBaseURL).toEqual("https://scicat.esss.se/api");
expect(LoopBackConfig.getPath()).toEqual("https://scicat.esss.se/api");
});

it(`should test app config values'`, () => {
it(`should test app config values'`, fakeAsync(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
app.ngOnInit();
fixture.detectChanges();
expect(app.config.scicatBaseUrl).toEqual("https://scicat.esss.se");
expect(app.config.lbBaseURL).toEqual("https://scicat.esss.se/api");
expect(LoopBackConfig.getPath()).toEqual("https://scicat.esss.se/api");
});
}));
});

0 comments on commit df08654

Please sign in to comment.