mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-17 05:26:47 +03:00
test(app): use the locale's labels in the background activity alignment e2e (#64221)
Co-authored-by: opencodejr[bot] <348916617+opencodejr[bot]@users.noreply.github.com> Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
8bd9bdf95d
commit
cdd0585e04
@@ -6,6 +6,8 @@ import { mockRemoteServer, mockWorkspace, openSession, openSettings, type Worksp
|
||||
import { CONSOLE_URL, consoleGateway, consoleSignIn } from "../utils/console"
|
||||
import { recordNotifications } from "../utils/notifications"
|
||||
import { installSseTransport } from "../utils/sse-transport"
|
||||
import { dict as ar } from "../../src/runtime/i18n/ar"
|
||||
import { dict as en } from "../../src/runtime/i18n/en"
|
||||
|
||||
const directory = "C:/Projects/settings-demo"
|
||||
|
||||
@@ -274,8 +276,20 @@ test("request events use real Questions settings without disabling Permissions a
|
||||
.toEqual([...previews, expect.stringContaining("alert-01"), expect.stringContaining("alert-01")])
|
||||
})
|
||||
|
||||
for (const locale of ["en", "ar"]) {
|
||||
for (const [locale, dict] of [
|
||||
["en", en],
|
||||
["ar", ar],
|
||||
] as const) {
|
||||
test(`background activity alignment stays physical and persists (${locale})`, async ({ page }) => {
|
||||
const label = dict["settings.timeline.row.backgroundActivity.title"]
|
||||
|
||||
const names = {
|
||||
Hidden: dict["settings.timeline.row.backgroundActivity.off"],
|
||||
Left: dict["settings.timeline.row.backgroundActivity.left"],
|
||||
Center: dict["settings.timeline.row.backgroundActivity.center"],
|
||||
Right: dict["settings.timeline.row.backgroundActivity.right"],
|
||||
}
|
||||
|
||||
const id = "ses_activity_settings"
|
||||
const childID = "ses_activity_settings_child"
|
||||
const stopped: string[] = []
|
||||
@@ -352,13 +366,13 @@ for (const locale of ["en", "ar"]) {
|
||||
for (const value of ["Center", "Right", "Hidden", "Left", "Right"] as const) {
|
||||
await page.keyboard.press("Control+,")
|
||||
const settings = page.getByTestId("settings-screen")
|
||||
const control = settings.getByLabel("Background activity", { exact: true })
|
||||
const control = settings.getByLabel(label, { exact: true })
|
||||
await expect(control).toBeVisible()
|
||||
await control.click()
|
||||
const options = page.getByRole("listbox")
|
||||
await expect(options.getByRole("option")).toHaveText(["Hidden", "Left", "Center", "Right"])
|
||||
await options.getByRole("option", { name: value, exact: true }).click()
|
||||
await expect(control).toHaveText(value)
|
||||
await expect(options.getByRole("option")).toHaveText([names.Hidden, names.Left, names.Center, names.Right])
|
||||
await options.getByRole("option", { name: names[value], exact: true }).click()
|
||||
await expect(control).toHaveText(names[value])
|
||||
await page.goBack()
|
||||
|
||||
if (value === "Hidden") {
|
||||
@@ -413,9 +427,7 @@ for (const locale of ["en", "ar"]) {
|
||||
.toBe("right")
|
||||
await page.keyboard.press("Control+,")
|
||||
await page.reload()
|
||||
await expect(page.getByTestId("settings-screen").getByLabel("Background activity", { exact: true })).toHaveText(
|
||||
"Right",
|
||||
)
|
||||
await expect(page.getByTestId("settings-screen").getByLabel(label, { exact: true })).toHaveText(names.Right)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user