Skip to content

Commit ff726da

Browse files
committed
test(e2e): cover rank/kind ordering of the backups servers panel
1 parent 2163f15 commit ff726da

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

private-web/e2e/backups.spec.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,58 @@ test.describe("backups ready: stats + backup-now", () => {
252252
.toBe("true:2");
253253
});
254254

255+
test("servers panel groups by rank then kind, like the group page", async ({
256+
page,
257+
sql,
258+
}) => {
259+
const group = await seedServerGroup(sql, { name: "rank-order-group" });
260+
// Seed out of display order: expected order is the production bucket
261+
// (central before facility) then clone then dev, with rank subheaders —
262+
// not insertion or alphabetical order.
263+
await seedServer(sql, {
264+
groupId: group.id,
265+
name: "aaa-dev",
266+
rank: "dev",
267+
});
268+
await seedServer(sql, {
269+
groupId: group.id,
270+
name: "aaa-prod-facility",
271+
rank: "production",
272+
kind: "facility",
273+
});
274+
await seedServer(sql, {
275+
groupId: group.id,
276+
name: "ccc-clone",
277+
rank: "clone",
278+
});
279+
await seedServer(sql, {
280+
groupId: group.id,
281+
name: "zzz-prod-central",
282+
rank: "production",
283+
kind: "central",
284+
});
285+
await seedServerGroupBackupConfig(sql, {
286+
groupId: group.id,
287+
status: "ready",
288+
});
289+
290+
await page.goto(`/groups/${group.id}/backups`);
291+
292+
const panel = page
293+
.getByRole("heading", { name: "Servers", exact: true })
294+
.locator("..");
295+
await expect(panel.locator('a[href^="/servers/"]')).toHaveText([
296+
"zzz-prod-central",
297+
"aaa-prod-facility",
298+
"ccc-clone",
299+
"aaa-dev",
300+
]);
301+
// Rank subheaders bucket the rows, same as the group page.
302+
await expect(panel.getByText("production", { exact: true })).toBeVisible();
303+
await expect(panel.getByText("clone", { exact: true })).toBeVisible();
304+
await expect(panel.getByText("dev", { exact: true })).toBeVisible();
305+
});
306+
255307
test("stats render with unknown bucket bytes and recent runs", async ({
256308
page,
257309
sql,

0 commit comments

Comments
 (0)