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.
This commit is contained in:
regexowl 2024-11-28 16:17:05 +01:00 committed by Lucas Garfield
parent 590855c7f3
commit 1533830095
2 changed files with 24 additions and 0 deletions

View file

@ -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<void> => {
@ -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);
});

View file

@ -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,