diff --git a/src/main/persistence-onboarding-language-cohort.test.ts b/src/main/persistence-onboarding-language-cohort.test.ts index 5575c7d60c2..a154155986a 100644 --- a/src/main/persistence-onboarding-language-cohort.test.ts +++ b/src/main/persistence-onboarding-language-cohort.test.ts @@ -32,9 +32,9 @@ afterEach(async () => { describe('persisted onboarding language cohorts', () => { it.each([ - { draw: 0, cohort: 'control', language: 'en' }, - { draw: 1, cohort: 'treatment', language: 'system' } - ])('retains $cohort through settings changes and restart', async ({ draw, cohort, language }) => { + { draw: 0, cohort: 'control' }, + { draw: 1, cohort: 'treatment' } + ])('retains $cohort through settings changes and restart', async ({ draw, cohort }) => { vi.mocked(crypto.randomInt).mockImplementation(() => draw) const store = createStore() const telemetry = store.getSettings().telemetry @@ -42,9 +42,10 @@ describe('persisted onboarding language cohorts', () => { throw new Error('Fresh profile has no telemetry settings') } expect(telemetry.onboardingLanguageCohort).toBe(cohort) - expect(store.getSettings().uiLanguage).toBe(language) + expect(store.getSettings().uiLanguage).toBe('system') store.flush() expect(readDataFile()).toHaveProperty('settings.telemetry.onboardingLanguageCohort', cohort) + expect(readDataFile()).toHaveProperty('settings.uiLanguage', 'system') store.updateSettings({ uiLanguage: 'fr' }) store.updateSettings({ telemetry: { ...telemetry, optedIn: false } }) diff --git a/src/main/persistence/loading-store/loaded-cohort-migrations.test.ts b/src/main/persistence/loading-store/loaded-cohort-migrations.test.ts index 8a1eab30684..281d9bdee2c 100644 --- a/src/main/persistence/loading-store/loaded-cohort-migrations.test.ts +++ b/src/main/persistence/loading-store/loaded-cohort-migrations.test.ts @@ -12,17 +12,17 @@ afterEach(() => vi.resetAllMocks()) describe('onboarding language experiment', () => { it.each([ - { draw: 0, cohort: 'control', language: 'en' }, - { draw: 1, cohort: 'treatment', language: 'system' } + { draw: 0, cohort: 'control' }, + { draw: 1, cohort: 'treatment' } ])( - 'assigns and freezes the $cohort experience for a new install', - ({ draw, cohort, language }) => { + 'assigns and freezes the $cohort experience with the system language for a new install', + ({ draw, cohort }) => { vi.mocked(crypto.randomInt).mockImplementation(() => draw) const runtime = { loadNeedsSave: false } const migration = new LoadedCohortMigrationOperations(runtime) const fresh = migration.migrateTelemetry(getDefaultPersistedState('/test'), false) expect(fresh.settings.telemetry?.onboardingLanguageCohort).toBe(cohort) - expect(fresh.settings.uiLanguage).toBe(language) + expect(fresh.settings.uiLanguage).toBe('system') expect(runtime.loadNeedsSave).toBe(true) const reopened = migration.migrateTelemetry(JSON.parse(JSON.stringify(fresh)), true) expect(reopened).toEqual(fresh) diff --git a/src/main/persistence/loading-store/loaded-cohort-migrations.ts b/src/main/persistence/loading-store/loaded-cohort-migrations.ts index 27e7608caa6..917046776d7 100644 --- a/src/main/persistence/loading-store/loaded-cohort-migrations.ts +++ b/src/main/persistence/loading-store/loaded-cohort-migrations.ts @@ -96,7 +96,6 @@ export class LoadedCohortMigrationOperations { ...state, settings: { ...state.settings, - ...(onboardingLanguageCohort === 'control' ? { uiLanguage: 'en' as const } : {}), telemetry: { ...existing, ...(onboardingLanguageCohort ? { onboardingLanguageCohort } : {}),