From 9fabc7f87dca90a5ddf436495eddf2ba9fb2b8bb Mon Sep 17 00:00:00 2001 From: Daragh King Date: Mon, 7 Oct 2024 10:26:12 +0100 Subject: [PATCH] test(time-zone-picker): set exact date for tests set exact date for tests so that the tests don't fail during DST changes --- .../gux-time-zone-picker.spec.ts.snap | 24 +++++++++---------- .../tests/gux-time-zone-picker.spec.ts | 2 ++ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/genesys-spark-components/src/components/beta/gux-time-zone-picker/tests/__snapshots__/gux-time-zone-picker.spec.ts.snap b/packages/genesys-spark-components/src/components/beta/gux-time-zone-picker/tests/__snapshots__/gux-time-zone-picker.spec.ts.snap index 4e1f7782a..6d8ef1b00 100644 --- a/packages/genesys-spark-components/src/components/beta/gux-time-zone-picker/tests/__snapshots__/gux-time-zone-picker.spec.ts.snap +++ b/packages/genesys-spark-components/src/components/beta/gux-time-zone-picker/tests/__snapshots__/gux-time-zone-picker.spec.ts.snap @@ -945,7 +945,7 @@ exports[`#render should render component as expected (1) 1`] = `
- Godthab, Greenland (UTC-01:00) + Godthab, Greenland (UTC-02:00)
@@ -1425,7 +1425,7 @@ exports[`#render should render component as expected (1) 1`] = `
- Nuuk, Greenland (UTC-01:00) + Nuuk, Greenland (UTC-02:00)
@@ -5658,7 +5658,7 @@ exports[`#render should render component as expected (1) 1`] = `
- Godthab, Greenland (UTC-01:00) + Godthab, Greenland (UTC-02:00)
@@ -6138,7 +6138,7 @@ exports[`#render should render component as expected (1) 1`] = `
- Nuuk, Greenland (UTC-01:00) + Nuuk, Greenland (UTC-02:00)
@@ -10376,7 +10376,7 @@ exports[`#render should render component as expected (2) 1`] = `
- Godthab, Greenland (UTC-01:00) + Godthab, Greenland (UTC-02:00)
@@ -10856,7 +10856,7 @@ exports[`#render should render component as expected (2) 1`] = `
- Nuuk, Greenland (UTC-01:00) + Nuuk, Greenland (UTC-02:00)
@@ -15089,7 +15089,7 @@ exports[`#render should render component as expected (2) 1`] = `
- Godthab, Greenland (UTC-01:00) + Godthab, Greenland (UTC-02:00)
@@ -15569,7 +15569,7 @@ exports[`#render should render component as expected (2) 1`] = `
- Nuuk, Greenland (UTC-01:00) + Nuuk, Greenland (UTC-02:00)
@@ -19819,7 +19819,7 @@ exports[`#render should render component as expected (3) 1`] = `
- Godthab, Greenland (UTC-01:00) + Godthab, Greenland (UTC-02:00)
@@ -20299,7 +20299,7 @@ exports[`#render should render component as expected (3) 1`] = `
- Nuuk, Greenland (UTC-01:00) + Nuuk, Greenland (UTC-02:00)
@@ -24532,7 +24532,7 @@ exports[`#render should render component as expected (3) 1`] = `
- Godthab, Greenland (UTC-01:00) + Godthab, Greenland (UTC-02:00)
@@ -25012,7 +25012,7 @@ exports[`#render should render component as expected (3) 1`] = `
- Nuuk, Greenland (UTC-01:00) + Nuuk, Greenland (UTC-02:00)
diff --git a/packages/genesys-spark-components/src/components/beta/gux-time-zone-picker/tests/gux-time-zone-picker.spec.ts b/packages/genesys-spark-components/src/components/beta/gux-time-zone-picker/tests/gux-time-zone-picker.spec.ts index a063ac601..28bff6ba3 100644 --- a/packages/genesys-spark-components/src/components/beta/gux-time-zone-picker/tests/gux-time-zone-picker.spec.ts +++ b/packages/genesys-spark-components/src/components/beta/gux-time-zone-picker/tests/gux-time-zone-picker.spec.ts @@ -10,6 +10,8 @@ describe('#render ', () => { `` ].forEach((html, index) => { it(`should render component as expected (${index + 1})`, async () => { + jest.useFakeTimers({ advanceTimers: true }); + jest.setSystemTime(new Date('2023-09-26')); const page = await newSpecPage({ components, html }); expect(page.root).toMatchSnapshot();