session-timeline-locale-projection.spec.ts 1.1 KB

12345678910111213141516171819202122232425
  1. import { expect, test } from "@playwright/test"
  2. import { assistantMessage, setupTimeline, toolPart, userMessage } from "../performance/timeline-stability/fixture"
  3. for (const profile of [
  4. { locale: "de", label: "Erkundet" },
  5. { locale: "ar", label: "تم الاستكشاف" },
  6. ] as const) {
  7. test(`projects translated context status in ${profile.locale}`, async ({ page }) => {
  8. const ids = [`prt_locale_${profile.locale}_01_read`, `prt_locale_${profile.locale}_02_glob`]
  9. await setupTimeline(page, {
  10. messages: [
  11. userMessage(),
  12. assistantMessage([
  13. toolPart(ids[0]!, "read", "completed", { filePath: "src/a.ts" }),
  14. toolPart(ids[1]!, "glob", "completed", { path: ".", pattern: "**/*.ts" }),
  15. ]),
  16. ],
  17. locale: profile.locale,
  18. })
  19. const group = page.locator(`[data-timeline-part-ids="${ids.join(",")}"]`)
  20. await expect(group.locator('[data-component="tool-status-title"]')).toHaveAttribute("aria-label", profile.label)
  21. await expect(page.locator("html")).toHaveAttribute("lang", profile.locale)
  22. })
  23. }