From ec67fd5f3b0eda8b627e31465757f5fa981757f1 Mon Sep 17 00:00:00 2001 From: Tobias Kohr Date: Wed, 18 Oct 2023 15:46:16 +0200 Subject: [PATCH] fix(md-info): only display abstract if defined --- .../lib/metadata-info/metadata-info.component.html | 2 +- .../metadata-info/metadata-info.component.spec.ts | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html b/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html index 33d6c46c72..f24145348a 100644 --- a/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +++ b/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html @@ -4,7 +4,7 @@ > record.metadata.about

-
+

{ component = fixture.componentInstance component.metadata = { ...DATASET_RECORDS[0], + abstract: null, useLimitations: null, accessConstraints: null, extras: { @@ -40,6 +41,11 @@ describe('MetadataInfoComponent', () => { fixture.nativeElement.querySelector('ng-container') expect(displayedElement).toBeFalsy() }) + it('should not display the abstract section', () => { + const displayedElement = + fixture.nativeElement.querySelector('.md-description') + expect(displayedElement).toBeFalsy() + }) }) describe('When a section is not empty', () => { @@ -53,7 +59,6 @@ describe('MetadataInfoComponent', () => { const displayedElement = fixture.nativeElement.querySelector('.noUsage') expect(displayedElement).toBeFalsy() }) - it('should display the keywords section', () => { // Use waitForAsync to handle asynchronous changes in the DOM. fixture.whenStable().then(() => { @@ -62,5 +67,10 @@ describe('MetadataInfoComponent', () => { expect(displayedElement).toBeTruthy() }) }) + it('should display the abstract section', () => { + const displayedElement = + fixture.nativeElement.querySelector('.md-description') + expect(displayedElement).toBeTruthy() + }) }) })