mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-30 05:02:58 +00:00
* fix(app): show PR panel state, activity verbs, and thread badges in the app language The PR panel's state label, the verb after each activity author, and the Resolved and Outdated thread badges were English literals, so they stayed English in every other language. The state and verb translations already existed and were unused; the badges get new keys in every locale. Closes #6214 * fix(app): translate every PR panel verb and state, and phrase them after the author The zh-CN state and review labels still held English ("Open", "Draft", "已 review"), and the Spanish and Portuguese verbs were adjectives that do not read after an author's name. The translation test now checks each verb and state on its own, so one English label fails it. Co-authored-by: Dillon <dillonzq@outlook.com> --------- Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com> Co-authored-by: Dillon <dillonzq@outlook.com>
50 lines
1.8 KiB
TypeScript
50 lines
1.8 KiB
TypeScript
import { expect, type Page } from "@playwright/test";
|
|
import { en } from "@/i18n/resources/en";
|
|
import { openPullRequestPanel } from "./workspace-tabs";
|
|
|
|
export async function openPrPane(page: Page): Promise<void> {
|
|
await openPullRequestPanel(page);
|
|
}
|
|
|
|
export async function expectPrPaneTitle(page: Page, title: string): Promise<void> {
|
|
await expect(page.getByTestId("pr-pane-title")).toContainText(title, { timeout: 15_000 });
|
|
}
|
|
|
|
export async function expectPrPaneState(
|
|
page: Page,
|
|
state: "open" | "merged" | "closed" | "draft",
|
|
): Promise<void> {
|
|
await expect(page.getByTestId("pr-pane-state")).toHaveText(en.workspace.git.pr.states[state], {
|
|
timeout: 15_000,
|
|
});
|
|
}
|
|
|
|
export async function expectPrPaneChecks(
|
|
page: Page,
|
|
checks: { success: string[]; failure: string[]; pending: string[] },
|
|
): Promise<void> {
|
|
const section = page.getByTestId("pr-pane-checks");
|
|
const groups = [
|
|
{ status: "failure", label: /failing checks?$/, names: checks.failure },
|
|
{ status: "pending", label: /in progress checks?$/, names: checks.pending },
|
|
{ status: "success", label: /successful checks?$/, names: checks.success },
|
|
];
|
|
|
|
for (const group of groups) {
|
|
const groupSection = section.getByTestId(`pr-pane-check-group-${group.status}`);
|
|
await expect(groupSection.getByRole("button", { name: group.label })).toBeVisible({
|
|
timeout: 15_000,
|
|
});
|
|
for (const name of group.names) {
|
|
await expect(groupSection.getByText(name, { exact: true })).toHaveCount(1);
|
|
}
|
|
}
|
|
}
|
|
|
|
export async function expectPrPaneActivity(page: Page, bodies: string[]): Promise<void> {
|
|
const activity = page.getByTestId("pr-pane-activity-row");
|
|
for (const body of bodies) {
|
|
await expect(activity.getByText(body, { exact: true })).toBeVisible({ timeout: 15_000 });
|
|
}
|
|
}
|