From b9bb386d556042d2b9619e2838bc383b9fa915f9 Mon Sep 17 00:00:00 2001 From: Ortwin Date: Wed, 27 Mar 2024 22:11:28 +0100 Subject: [PATCH] get navigation from firestore --- src/app/components/app.component.spec.ts | 9 ++ src/app/components/nav/nav.component.html | 4 +- src/app/components/nav/nav.component.spec.ts | 13 +++ src/app/components/nav/nav.component.ts | 104 ++++++++++-------- src/app/models/nav.model.ts | 8 ++ src/app/services/common.service.spec.ts | 16 +++ src/app/services/common.service.ts | 22 ++++ src/app/services/firestore.service.spec.ts | 5 +- src/app/services/firestore.service.ts | 5 +- .../services/user-progress.service.spec.ts | 2 +- 10 files changed, 129 insertions(+), 59 deletions(-) create mode 100644 src/app/models/nav.model.ts create mode 100644 src/app/services/common.service.spec.ts create mode 100644 src/app/services/common.service.ts diff --git a/src/app/components/app.component.spec.ts b/src/app/components/app.component.spec.ts index 4203d55..e077c04 100644 --- a/src/app/components/app.component.spec.ts +++ b/src/app/components/app.component.spec.ts @@ -1,11 +1,20 @@ import { TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { AppComponent } from './app.component'; +import { CommonService } from '../services/common.service'; describe('AppComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [AppComponent, NoopAnimationsModule], + providers: [ + { + provide: CommonService, + useValue: { + getNavigation: () => Promise.resolve([]) + } + } + ], }).compileComponents(); }); diff --git a/src/app/components/nav/nav.component.html b/src/app/components/nav/nav.component.html index ad11d56..02c3f87 100644 --- a/src/app/components/nav/nav.component.html +++ b/src/app/components/nav/nav.component.html @@ -15,7 +15,7 @@