import { expect, type Page } from "@playwright/test" import { backup } from "./backups" export async function openBackup(page: Page) { await page.goto("/backups"); await page.getByRole("button", { name: "Новый бэкап", exact: true }).first().click() const dialog = page.getByRole("dialog") await dialog.getByRole("checkbox", { name: /Выбрать Роутер/ }).check() await dialog.getByRole("button", { name: "Далее", exact: true }).click() await dialog.getByRole("textbox", { name: "Заметка резервной копии", exact: true }).fill("manual") await dialog.getByRole("button", { name: "Далее", exact: true }).click() await expect(dialog.getByRole("button", { name: /Снять бэкап/ })).toBeEnabled() return dialog } export function backupJob(id: string, patch: Record = {}) { return { id, status: "done", serverIds: ["1"], notes: "manual", total: 1, completed: 1, created: [backup], failures: [], requestedAt: "2026-10-01T00:00:00Z", finishedAt: "2026-10-01T00:01:00Z", ...patch } } export function backupAck(id: string) { return { jobId: id, status: "queued", serverIds: ["1"], total: 1, completed: 0 } }