From e13c8fa92d3be45c2fae7320f97ebe1380f36820 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 16 Mar 2023 16:30:21 +0100 Subject: [PATCH 1/3] fix: remove unnecessary import to reduce scss file size (#1774) --- src/styles/variables/_colors.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/src/styles/variables/_colors.scss b/src/styles/variables/_colors.scss index 75e0cddc38..919471df3a 100644 --- a/src/styles/variables/_colors.scss +++ b/src/styles/variables/_colors.scss @@ -14,7 +14,6 @@ * You should have received a copy of the GNU General Public License * along with ndb-core. If not, see . */ -@use "../themes/ndb-theme" as theme; @use "@angular/material" as mat; $err-palette : mat.define-palette(mat.$red-palette); From bbde2c119ee767eb415fe53f2a0e41d5277804ab Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 16 Mar 2023 17:25:09 +0100 Subject: [PATCH 2/3] fix: error when relation does not have matching child (#1775) --- src/app/app.component.spec.ts | 25 +------------------ .../children/children.service.ts | 4 ++- 2 files changed, 4 insertions(+), 25 deletions(-) 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; } From abb6761d085073f866c1deeb682518933b33df34 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 16 Mar 2023 18:03:40 +0100 Subject: [PATCH 3/3] test: config leak between test --- src/app/app.component.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index bd70f824ae..0bda7e47a3 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -49,6 +49,8 @@ describe("AppComponent", () => { }); beforeEach(waitForAsync(() => { environment.session_type = SessionType.mock; + environment.production = false; + environment.demo_mode = false; const entityMapper = mockEntityMapper(); entityUpdates = new Subject(); spyOn(entityMapper, "receiveUpdates").and.returnValue(entityUpdates); @@ -76,7 +78,6 @@ describe("AppComponent", () => { it("should start tracking with config from db", fakeAsync(() => { environment.production = true; // tracking is only active in production mode - environment.demo_mode = false; const testConfig = new Config(Config.CONFIG_KEY, { [USAGE_ANALYTICS_CONFIG_ID]: { url: "matomo-test-endpoint",