From 75fd545e8a16877ba543fd093b28967c8a167384 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Thu, 21 Oct 2021 16:58:18 +0000 Subject: [PATCH 1/4] add standalone test --- core/src/components/datetime/datetime.scss | 7 +-- .../datetime/test/standalone/index.html | 52 +++++++++++++++++++ 2 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 core/src/components/datetime/test/standalone/index.html diff --git a/core/src/components/datetime/datetime.scss b/core/src/components/datetime/datetime.scss index c5e5c6c26a0..7cd774e240c 100644 --- a/core/src/components/datetime/datetime.scss +++ b/core/src/components/datetime/datetime.scss @@ -19,14 +19,9 @@ overflow: hidden; } -:host(.datetime-presentation-date-time), -:host(.datetime-presentation-time-date), -:host(.datetime-presentation-date) { - height: 100%; -} - :host(.datetime-size-fixed) { width: 350px; + height: auto; } :host(.datetime-size-cover) { diff --git a/core/src/components/datetime/test/standalone/index.html b/core/src/components/datetime/test/standalone/index.html new file mode 100644 index 00000000000..4e01cb78c4b --- /dev/null +++ b/core/src/components/datetime/test/standalone/index.html @@ -0,0 +1,52 @@ + + + + + Datetime - Standalone + + + + + + + + + + + + + + + +

+ + + + + + From b08825b0d6f46aad55150ad820b21585969dbe5d Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Thu, 21 Oct 2021 14:17:52 -0400 Subject: [PATCH 2/4] fix(datetime): fix sizing, add tests --- .../src/components/datetime/datetime.ios.scss | 2 +- core/src/components/datetime/datetime.scss | 5 +- .../components/datetime/test/display/e2e.ts | 54 +++++++++++++++++++ .../test/{standalone => display}/index.html | 12 ++--- 4 files changed, 64 insertions(+), 9 deletions(-) create mode 100644 core/src/components/datetime/test/display/e2e.ts rename core/src/components/datetime/test/{standalone => display}/index.html (81%) diff --git a/core/src/components/datetime/datetime.ios.scss b/core/src/components/datetime/datetime.ios.scss index 7507681e0d9..7935d69f441 100644 --- a/core/src/components/datetime/datetime.ios.scss +++ b/core/src/components/datetime/datetime.ios.scss @@ -11,7 +11,7 @@ :host(.datetime-presentation-date-time), :host(.datetime-presentation-time-date), :host(.datetime-presentation-date) { - min-height: 300px; + min-height: 350px; } // Header diff --git a/core/src/components/datetime/datetime.scss b/core/src/components/datetime/datetime.scss index 7cd774e240c..4de3d48744a 100644 --- a/core/src/components/datetime/datetime.scss +++ b/core/src/components/datetime/datetime.scss @@ -20,13 +20,14 @@ } :host(.datetime-size-fixed) { - width: 350px; + max-width: 350px; + + width: auto; height: auto; } :host(.datetime-size-cover) { width: 100%; - min-width: 350px; } :host .calendar-body, diff --git a/core/src/components/datetime/test/display/e2e.ts b/core/src/components/datetime/test/display/e2e.ts new file mode 100644 index 00000000000..9a92b0d709d --- /dev/null +++ b/core/src/components/datetime/test/display/e2e.ts @@ -0,0 +1,54 @@ +import { newE2EPage } from '@stencil/core/testing'; + +test('display', async () => { + const page = await newE2EPage({ + url: '/src/components/datetime/test/display?ionic:_testing=true' + }); + + const screenshotCompares = []; + + await page.select('#presentation', 'date-time'); + await page.waitForChanges(); + + screenshotCompares.push(await page.compareScreenshot()); + + await page.select('#presentation', 'time-date'); + await page.waitForChanges(); + + screenshotCompares.push(await page.compareScreenshot()); + + await page.select('#presentation', 'time'); + await page.waitForChanges(); + + screenshotCompares.push(await page.compareScreenshot()); + + await page.select('#presentation', 'date'); + await page.waitForChanges(); + + screenshotCompares.push(await page.compareScreenshot()); + + await page.select('#size', 'fixed'); + await page.select('#presentation', 'date-time'); + await page.waitForChanges(); + + screenshotCompares.push(await page.compareScreenshot()); + + await page.select('#presentation', 'time-date'); + await page.waitForChanges(); + + screenshotCompares.push(await page.compareScreenshot()); + + await page.select('#presentation', 'time'); + await page.waitForChanges(); + + screenshotCompares.push(await page.compareScreenshot()); + + await page.select('#presentation', 'date'); + await page.waitForChanges(); + + screenshotCompares.push(await page.compareScreenshot()); + + for (const screenshotCompare of screenshotCompares) { + expect(screenshotCompare).toMatchScreenshot(); + } +}); diff --git a/core/src/components/datetime/test/standalone/index.html b/core/src/components/datetime/test/display/index.html similarity index 81% rename from core/src/components/datetime/test/standalone/index.html rename to core/src/components/datetime/test/display/index.html index 4e01cb78c4b..a69f6a91367 100644 --- a/core/src/components/datetime/test/standalone/index.html +++ b/core/src/components/datetime/test/display/index.html @@ -21,17 +21,17 @@

From 8c159c232e1159d545c9f8d77e8e345ed5105221 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Thu, 21 Oct 2021 19:07:30 +0000 Subject: [PATCH 3/4] chore(): lint --- core/src/components/datetime/datetime.scss | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/src/components/datetime/datetime.scss b/core/src/components/datetime/datetime.scss index 4de3d48744a..a5ea17f4cd8 100644 --- a/core/src/components/datetime/datetime.scss +++ b/core/src/components/datetime/datetime.scss @@ -20,9 +20,8 @@ } :host(.datetime-size-fixed) { - max-width: 350px; - width: auto; + max-width: 350px; height: auto; } From 16dcbd4cd0e4b437291806ab0152d6c9322782c9 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Thu, 21 Oct 2021 16:32:23 -0400 Subject: [PATCH 4/4] Update core/src/components/datetime/test/display/e2e.ts Co-authored-by: Amanda Smith <90629384+amandaesmith3@users.noreply.github.com> --- core/src/components/datetime/test/display/e2e.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/components/datetime/test/display/e2e.ts b/core/src/components/datetime/test/display/e2e.ts index 9a92b0d709d..e763b6b3407 100644 --- a/core/src/components/datetime/test/display/e2e.ts +++ b/core/src/components/datetime/test/display/e2e.ts @@ -27,7 +27,7 @@ test('display', async () => { screenshotCompares.push(await page.compareScreenshot()); - await page.select('#size', 'fixed'); + await page.select('#size', 'cover'); await page.select('#presentation', 'date-time'); await page.waitForChanges();