From 15338300951184272059f69316ae9993b895e9ce Mon Sep 17 00:00:00 2001 From: regexowl Date: Thu, 28 Nov 2024 16:17:05 +0100 Subject: [PATCH] Wizard: Add Timezone to on-prem mapper This adds Timezone values to the on-prem mapper and updates the import test to check for expected values. --- .../Blueprints/ImportBlueprintModal.test.tsx | 17 +++++++++++++++++ .../helpers/onPremToHostedBlueprintMapper.tsx | 7 +++++++ 2 files changed, 24 insertions(+) diff --git a/src/Components/Blueprints/ImportBlueprintModal.test.tsx b/src/Components/Blueprints/ImportBlueprintModal.test.tsx index ef3683b4..9a041906 100644 --- a/src/Components/Blueprints/ImportBlueprintModal.test.tsx +++ b/src/Components/Blueprints/ImportBlueprintModal.test.tsx @@ -172,6 +172,10 @@ minsize = 2147483648 [customizations.installer] unattended = true sudo-nopasswd = ["user", "%wheel"] + +[customizations.timezone] +timezone = "US/Eastern" +ntpservers = ["0.north-america.pool.ntp.org", "1.north-america.pool.ntp.org"] `; const uploadFile = async (filename: string, content: string): Promise => { @@ -340,6 +344,19 @@ describe('Import modal', () => { await user.click(await screen.findByTestId('packages-selected-toggle')) ); + // Users + await clickNext(); + + // Timezone + await clickNext(); + await screen.findByRole('heading', { name: /Timezone/ }); + const timezoneDropDown = await screen.findByPlaceholderText( + /Select a timezone/i + ); + expect(timezoneDropDown).toHaveValue('US/Eastern'); + await screen.findByText(/0\.north-america\.pool\.ntp\.org/i); + await screen.findByText(/1\.north-america\.pool\.ntp\.org/i); + await clickNext(); }, 20000); }); diff --git a/src/Components/Blueprints/helpers/onPremToHostedBlueprintMapper.tsx b/src/Components/Blueprints/helpers/onPremToHostedBlueprintMapper.tsx index c3e55cd6..5c7b4a3b 100644 --- a/src/Components/Blueprints/helpers/onPremToHostedBlueprintMapper.tsx +++ b/src/Components/Blueprints/helpers/onPremToHostedBlueprintMapper.tsx @@ -146,6 +146,13 @@ export const mapOnPremToHosted = ( enabled: blueprint.customizations?.fips, } : undefined, + timezone: + blueprint.customizations?.timezone !== undefined + ? { + timezone: blueprint.customizations.timezone.timezone, + ntpservers: blueprint.customizations.timezone.ntpservers, + } + : undefined, }, metadata: { parent_id: null,