Wizard: Add Locale to on-prem mapper

This adds Locale values to the on-prem mapper and updates the import test to check for expected values.
This commit is contained in:
regexowl 2024-12-09 15:05:46 +01:00 committed by Lucas Garfield
parent 0d952fc878
commit 93de07c729
2 changed files with 21 additions and 0 deletions

View file

@ -176,6 +176,10 @@ sudo-nopasswd = ["user", "%wheel"]
[customizations.timezone]
timezone = "US/Eastern"
ntpservers = ["0.north-america.pool.ntp.org", "1.north-america.pool.ntp.org"]
[customizations.locale]
languages = ["en_US.UTF-8", "ja_JP.UTF-8"]
keyboard = "us"
`;
const uploadFile = async (filename: string, content: string): Promise<void> => {
@ -357,6 +361,16 @@ describe('Import modal', () => {
await screen.findByText(/0\.north-america\.pool\.ntp\.org/i);
await screen.findByText(/1\.north-america\.pool\.ntp\.org/i);
// Locale
await clickNext();
await screen.findByRole('heading', { name: /Locale/ });
await screen.findByText('en_US.UTF-8');
await screen.findByText('ja_JP.UTF-8');
const keyboardDropDown = await screen.findByPlaceholderText(
/Select a keyboard/i
);
expect(keyboardDropDown).toHaveValue('us');
await clickNext();
}, 20000);
});

View file

@ -153,6 +153,13 @@ export const mapOnPremToHosted = (
ntpservers: blueprint.customizations.timezone.ntpservers,
}
: undefined,
locale:
blueprint.customizations?.locale !== undefined
? {
languages: blueprint.customizations.locale.languages,
keyboard: blueprint.customizations.locale.keyboard,
}
: undefined,
},
metadata: {
parent_id: null,