From 51db788f03e3ee4fe59a6ac82481ca57f4e91412 Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Tue, 2 Jul 2024 10:01:03 +0200 Subject: [PATCH] fix: fix unit tests --- .../record-metadata/record-metadata.component.spec.ts | 4 ++-- .../data-view-permalink.component.spec.ts | 6 +++--- .../data-view-web-component.component.spec.ts | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/datahub/src/app/record/record-metadata/record-metadata.component.spec.ts b/apps/datahub/src/app/record/record-metadata/record-metadata.component.spec.ts index 589d2a4aa4..0b23b693b5 100644 --- a/apps/datahub/src/app/record/record-metadata/record-metadata.component.spec.ts +++ b/apps/datahub/src/app/record/record-metadata/record-metadata.component.spec.ts @@ -451,9 +451,9 @@ describe('RecordMetadataComponent', () => { fixture.debugElement.query(By.directive(MockDataViewShareComponent)) ).toBeTruthy() }) - describe('when selectedTabIndex$ is 2 (chart tab)', () => { + describe('when selectedView$ is chart', () => { beforeEach(() => { - component.selectedTabIndex$.next(2) + component.selectedView$.next('chart') fixture.detectChanges() }) it('renders the permalink component', () => { diff --git a/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.spec.ts b/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.spec.ts index f93ecb8541..848ee4bac4 100644 --- a/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.spec.ts +++ b/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.spec.ts @@ -75,7 +75,7 @@ describe('DataViewPermalinkComponent', () => { facade = TestBed.inject(MdViewFacade) fixture = TestBed.createComponent(DataViewPermalinkComponent) component = fixture.componentInstance - component.tabIndex$.next(2) + component.viewType$.next('chart') fixture.detectChanges() }) @@ -126,7 +126,7 @@ describe('DataViewPermalinkComponent', () => { }) describe('Map view', () => { beforeEach(() => { - component.tabIndex$.next(0) + component.viewType$.next('map') }) describe('init permalinkUrl$', () => { it('should generate URL based on configs', async () => { @@ -143,7 +143,7 @@ describe('DataViewPermalinkComponent', () => { }) describe('Table view', () => { beforeEach(() => { - component.tabIndex$.next(1) + component.viewType$.next('table') }) describe('init permalinkUrl$', () => { it('should generate URL based on configs', async () => { diff --git a/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.spec.ts b/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.spec.ts index 38221b2293..7521751966 100644 --- a/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.spec.ts +++ b/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.spec.ts @@ -69,7 +69,7 @@ describe('DataViewWebComponentComponent', () => { facade = TestBed.inject(MdViewFacade) fixture = TestBed.createComponent(DataViewWebComponentComponent) component = fixture.componentInstance - component.tabIndex$.next(2) + component.viewType$.next('chart') fixture.detectChanges() }) @@ -128,7 +128,7 @@ describe('DataViewWebComponentComponent', () => { }) describe('Map view', () => { beforeEach(() => { - component.tabIndex$.next(0) + component.viewType$.next('map') }) describe('init webComponentHtml$', () => { it('should generate HTML based on configs', async () => { @@ -151,7 +151,7 @@ describe('DataViewWebComponentComponent', () => { }) describe('Table view', () => { beforeEach(() => { - component.tabIndex$.next(1) + component.viewType$.next('table') }) describe('init webComponentHtml$', () => { it('should generate HTML based on configs', async () => {