e2e(server): broken test after switch to combobox

This commit is contained in:
Elian Doran 2025-10-16 08:16:48 +03:00
parent 5d961e1a9a
commit 0958204779
No known key found for this signature in database

View File

@ -42,19 +42,21 @@ test("User can change language from settings", async ({ page, context }) => {
// Check that the default value (English) is set.
await expect(app.currentNoteSplit).toContainText("First day of the week");
const languageCombobox = app.currentNoteSplit.getByRole("combobox").first();
await expect(languageCombobox).toHaveValue("en");
const languageCombobox = app.currentNoteSplit.locator(".options-section .dropdown").first();
await expect(languageCombobox).toContainText("English");
// Select Chinese and ensure the translation is set.
await languageCombobox.selectOption("cn");
await languageCombobox.locator(".dropdown-toggle").click();
await languageCombobox.locator(".dropdown-item", { hasText: "简体中文" }).click();
await app.currentNoteSplit.locator("button[name=restart-app-button]").click();
await expect(app.currentNoteSplit).toContainText("一周的第一天", { timeout: 15000 });
await expect(languageCombobox).toHaveValue("cn");
await expect(languageCombobox).toContainText("简体中文");
// Select English again.
await languageCombobox.selectOption("en");
await languageCombobox.locator(".dropdown-toggle").click();
await languageCombobox.locator(".dropdown-item", { hasText: "English" }).click();
await app.currentNoteSplit.locator("button[name=restart-app-button]").click();
await expect(app.currentNoteSplit).toContainText("Language", { timeout: 15000 });
await expect(languageCombobox).toHaveValue("en");
await expect(languageCombobox).toContainText("English");
});