client/options: fix failing test

This commit is contained in:
Adorian Doran 2025-03-13 06:10:09 +02:00
parent eb630c80d6
commit 10de4e798b

View File

@ -26,7 +26,7 @@ test("Displays translations in Settings", async ({ page, context }) => {
await app.goto(); await app.goto();
await app.closeAllTabs(); await app.closeAllTabs();
await app.goToSettings(); await app.goToSettings();
await app.noteTree.getByText("Appearance").click(); await app.noteTree.getByText("Language & Region").click();
await expect(app.currentNoteSplit).toContainText("Localization"); await expect(app.currentNoteSplit).toContainText("Localization");
await expect(app.currentNoteSplit).toContainText("Language"); await expect(app.currentNoteSplit).toContainText("Language");
@ -38,16 +38,16 @@ test("User can change language from settings", async ({ page, context }) => {
await app.closeAllTabs(); await app.closeAllTabs();
await app.goToSettings(); await app.goToSettings();
await app.noteTree.getByText("Appearance").click(); await app.noteTree.getByText("Language & Region").click();
// Check that the default value (English) is set. // Check that the default value (English) is set.
await expect(app.currentNoteSplit).toContainText("Theme"); await expect(app.currentNoteSplit).toContainText("First day of the week");
const languageCombobox = app.currentNoteSplit.getByRole("combobox").first(); const languageCombobox = app.currentNoteSplit.getByRole("combobox").first();
await expect(languageCombobox).toHaveValue("en"); await expect(languageCombobox).toHaveValue("en");
// Select Chinese and ensure the translation is set. // Select Chinese and ensure the translation is set.
await languageCombobox.selectOption("cn"); await languageCombobox.selectOption("cn");
await expect(app.currentNoteSplit).toContainText("主题", { timeout: 15000 }); await expect(app.currentNoteSplit).toContainText("一周的第一天", { timeout: 15000 });
await expect(languageCombobox).toHaveValue("cn"); await expect(languageCombobox).toHaveValue("cn");
// Select English again. // Select English again.