diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 56f6f79316..bd70f824ae 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -34,7 +34,6 @@ import { Database } from "./core/database/database"; import { UpdatedEntity } from "./core/entity/model/entity-update"; import { EntityMapperService } from "./core/entity/entity-mapper.service"; import { mockEntityMapper } from "./core/entity/mock-entity-mapper-service"; -import { DemoDataService } from "./core/demo-data/demo-data.service"; import { SessionType } from "./core/session/session-type"; import { HttpClientTestingModule } from "@angular/common/http/testing"; import { Angulartics2Matomo } from "angulartics2"; @@ -44,17 +43,10 @@ describe("AppComponent", () => { let component: AppComponent; let fixture: ComponentFixture; let entityUpdates: Subject>; - const defaultTimeout = jasmine.DEFAULT_TIMEOUT_INTERVAL; beforeAll(() => { componentRegistry.allowDuplicates(); - jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000; }); - - afterAll(() => { - jasmine.DEFAULT_TIMEOUT_INTERVAL = defaultTimeout; - }); - beforeEach(waitForAsync(() => { environment.session_type = SessionType.mock; const entityMapper = mockEntityMapper(); @@ -75,10 +67,7 @@ describe("AppComponent", () => { fixture.detectChanges(); } - afterEach(() => { - fixture.debugElement.nativeElement.style.visibility = "hidden"; - return TestBed.inject(Database).destroy(); - }); + afterEach(() => TestBed.inject(Database).destroy()); it("should be created", () => { createComponent(); @@ -110,16 +99,4 @@ describe("AppComponent", () => { discardPeriodicTasks(); })); - - xit("published the demo data", fakeAsync(() => { - // TODO the lazy loading throws an error in this test - environment.demo_mode = true; - - createComponent(); - flush(); - discardPeriodicTasks(); - const demoDataService = TestBed.inject(DemoDataService); - expect(demoDataService).toBeTruthy(); - environment.demo_mode = false; - })); }); diff --git a/src/app/child-dev-project/children/children.service.ts b/src/app/child-dev-project/children/children.service.ts index 83dc8a5312..6458eadcc2 100644 --- a/src/app/child-dev-project/children/children.service.ts +++ b/src/app/child-dev-project/children/children.service.ts @@ -34,7 +34,9 @@ export class ChildrenService { const relations = await this.queryRelations(`${Child.ENTITY_TYPE}:`); groupBy(relations, "childId").forEach(([id, rels]) => { const child = children.find((c) => c.getId() === id); - this.extendChildWithSchoolInfo(child, rels); + if (child) { + this.extendChildWithSchoolInfo(child, rels); + } }); return children; }