From 4ae1c2f5d582b84855f1e1b5b7d306a674d969d2 Mon Sep 17 00:00:00 2001 From: Bizz <56281168+dr-bizz@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:15:29 -0400 Subject: [PATCH] Adding Spacer support (#142) * Adding Spacer support * Updating tests to FIXED spacers --- src/app/_tests/mocks.ts | 14 +++++++++- .../content-spacer.component.css | 4 +++ .../content-spacer.component.html | 5 ++++ .../content-spacer.component.spec.ts | 27 +++++++++++++++++++ .../content-spacer.component.ts | 4 +-- 5 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 src/app/new-page/component/content-spacer/content-spacer.component.spec.ts diff --git a/src/app/_tests/mocks.ts b/src/app/_tests/mocks.ts index 438dbf330..c4be745f3 100644 --- a/src/app/_tests/mocks.ts +++ b/src/app/_tests/mocks.ts @@ -17,7 +17,8 @@ import { MultiselectOption, Flow, FlowItem, - Card + Card, + Spacer } from 'src/app/services/xml-parser-service/xmp-parser.service'; import { org } from '@cruglobal/godtools-shared'; @@ -542,3 +543,14 @@ export const mockPageComponent = { } } }; + +export const mockSpacer = (height = 100): Spacer => { + return { + height, + mode: { + name: 'FIXED', + ordinal: 0 + }, + ...standardTypeValues() + }; +}; diff --git a/src/app/new-page/component/content-spacer/content-spacer.component.css b/src/app/new-page/component/content-spacer/content-spacer.component.css index e69de29bb..2cd321df5 100644 --- a/src/app/new-page/component/content-spacer/content-spacer.component.css +++ b/src/app/new-page/component/content-spacer/content-spacer.component.css @@ -0,0 +1,4 @@ +.spacer { + display: block; + width: 100%; +} \ No newline at end of file diff --git a/src/app/new-page/component/content-spacer/content-spacer.component.html b/src/app/new-page/component/content-spacer/content-spacer.component.html index 8605915c5..0b23351f9 100644 --- a/src/app/new-page/component/content-spacer/content-spacer.component.html +++ b/src/app/new-page/component/content-spacer/content-spacer.component.html @@ -1 +1,6 @@ +
diff --git a/src/app/new-page/component/content-spacer/content-spacer.component.spec.ts b/src/app/new-page/component/content-spacer/content-spacer.component.spec.ts new file mode 100644 index 000000000..6912c3c6a --- /dev/null +++ b/src/app/new-page/component/content-spacer/content-spacer.component.spec.ts @@ -0,0 +1,27 @@ +import { SimpleChange } from '@angular/core'; +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { mockSpacer } from '../../../_tests/mocks'; +import { ContentSpacerNewComponent } from './content-spacer.component'; + +describe('ContentSpacerComponent', () => { + let component: ContentSpacerNewComponent; + let fixture: ComponentFixture