import { describe, expect, it } from "vitest"; import { onboardingProfileUpdate } from "./onboarding-profile"; describe("onboardingProfileUpdate", () => { it("fills the time zone, locale and chosen language from the browser", () => { expect( onboardingProfileUpdate({ browserTimeZone: "Europe/Vienna", locale: "de-AT", language: "de", }), ).toEqual({ timeZone: "Europe/Vienna", locale: "de-AT", language: "de" }); }); it("leaves out a language the user did not pick and malformed values", () => { expect( onboardingProfileUpdate({ browserTimeZone: "Not/AZone", locale: "not a tag", language: null, }), ).toEqual({}); expect(onboardingProfileUpdate({ browserTimeZone: "UTC" })).toEqual({ timeZone: "UTC" }); }); });