mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-10 10:25:03 +00:00
A release entry now opens with a short list of highlights above its first section. The What's new sheet, the website changelog and the GitHub release body show those and keep the sections, the full record, behind one control, so a 100-bullet release reads as ten lines. CHANGELOG.md stays plain Markdown because the app and the website render it without HTML, including apps already installed. Each surface folds the sections itself; only the release body gets a <details> block, written by Release Notes Sync. A release with nothing before its first section shows its sections as before. Adds the 0.16.0-beta.1 entry in the new format, with its Chinese translation, and the highlight writing rules in docs/release.md.
45 lines
1.7 KiB
TypeScript
45 lines
1.7 KiB
TypeScript
import { expect, type Locator, type Page } from "@playwright/test";
|
|
|
|
const CHANGELOG_SOURCE_URL = "https://raw.githubusercontent.com/getpaseo/paseo/main/CHANGELOG.md";
|
|
|
|
/**
|
|
* Serves a changelog to the app instead of the repository's.
|
|
*
|
|
* The sheet renders whatever the document contains, so a fixture is how a test
|
|
* states which authoring shapes it cares about.
|
|
*/
|
|
export async function serveChangelog(page: Page, lines: string[]): Promise<void> {
|
|
await page.route(CHANGELOG_SOURCE_URL, (route) =>
|
|
route.fulfill({ status: 200, contentType: "text/plain", body: lines.join("\n") }),
|
|
);
|
|
}
|
|
|
|
export async function openWhatsNew(page: Page): Promise<Locator> {
|
|
await page.getByTestId("sidebar-help").click();
|
|
await expect(page.getByTestId("sidebar-help-menu")).toBeVisible();
|
|
await page.getByTestId("sidebar-help-changelog").click();
|
|
|
|
const sheet = page.getByTestId("changelog-sheet");
|
|
await expect(sheet).toBeVisible();
|
|
return sheet;
|
|
}
|
|
|
|
export function release(sheet: Locator, version: string): Locator {
|
|
return sheet.getByTestId(`changelog-release-${version}`);
|
|
}
|
|
|
|
/** The one control a release with highlights has for its sections, in either state. */
|
|
export function allChangesToggle(entry: Locator): Locator {
|
|
return entry.getByRole("button", { name: /^(Show|Hide) all changes$/ });
|
|
}
|
|
|
|
export async function showAllChanges(entry: Locator): Promise<void> {
|
|
await entry.getByRole("button", { name: "Show all changes" }).click();
|
|
await expect(entry.getByRole("button", { name: "Hide all changes" })).toBeVisible();
|
|
}
|
|
|
|
export async function hideAllChanges(entry: Locator): Promise<void> {
|
|
await entry.getByRole("button", { name: "Hide all changes" }).click();
|
|
await expect(entry.getByRole("button", { name: "Show all changes" })).toBeVisible();
|
|
}
|