Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

test(memory): isolate backup panel accessibility and preserve failure evidence

Rahman32a8bf9e5085
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index 632a1623..44200130 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -12,6 +12,12 @@ mandatory release journey now includes the actual Settings backup UI at desktop,
phone and landscape sizes, error/retry and accessibility checks, synthetic backup
transport, and real API role refusals before any private backup access. Full gate
and production evidence remain release obligations, not assertions made here.
+The first browser run also exposed an over-broad new test selector: it matched
+the desktop shell ancestor and included an existing Terminal window. The backup
+journey now names its exact feature root without disabling any accessibility rule.
+The observed Terminal tablist/input-label findings remain separate UI debt, not
+fixed by this selector correction. Failure receipts now include assertion errors
+and an explicit pass flag; an empty page-error list alone is never success.
History pagination is not resumable copying. Source-release review, complete and
offsite backup, learning coverage and Jev admission remain separate open work.
diff --git a/frontend/slices/os-settings/components/backup-section.tsx b/frontend/slices/os-settings/components/backup-section.tsx
index d1ae6e86..800fec65 100644
--- a/frontend/slices/os-settings/components/backup-section.tsx
+++ b/frontend/slices/os-settings/components/backup-section.tsx
@@ -57,7 +57,7 @@ export function BackupSection() {
};
return (
- <div className="space-y-4 sm:space-y-5">
+ <div data-slot="backup-settings" className="space-y-4 sm:space-y-5">
<ServerBackupSection />
<SettingsSection
icon={<DatabaseBackup />}
diff --git a/scripts/e2e/memory-backup-history.mjs b/scripts/e2e/memory-backup-history.mjs
index 0a951abd..a69d6377 100644
--- a/scripts/e2e/memory-backup-history.mjs
+++ b/scripts/e2e/memory-backup-history.mjs
@@ -10,7 +10,7 @@ const snapshot = { id, state: "partial", createdAt: "2026-01-01T00:00:00.000Z",
export async function memoryBackupHistoryJourney(page, fixture) {
const pattern = "**/api/v1/sys/memory-backup**", checks = [], screenshots = [], errors = [];
const onError = error => errors.push(error.message); page.on("pageerror", onError);
- let fail = false, posts = [], queries = [];
+ let fail = false, passed = false, posts = [], queries = [];
await page.route(pattern, async route => {
const req = route.request(), url = new URL(req.url());
if (req.method() === "POST") {
@@ -34,6 +34,7 @@ export async function memoryBackupHistoryJourney(page, fixture) {
await page.goto(fixture.base + "/settings?section=backup");
await expect(page.getByText("Server memory backup", { exact: true })).toBeVisible();
await expect(page.getByText("Browser backup", { exact: true })).toBeVisible();
+ await expect(page.locator('[data-slot="backup-settings"]')).toHaveCount(1);
expect(queries).toHaveLength(0); expect(posts).toHaveLength(0);
await page.getByRole("button", { name: "Load saved server snapshots", exact: true }).click();
await expect(page.getByText(/Partial snapshot · 2 files · No saved integrity receipt/)).toBeVisible();
@@ -48,8 +49,8 @@ export async function memoryBackupHistoryJourney(page, fixture) {
for (const theme of ["light", "dark"]) {
await page.evaluate(value => document.documentElement.dataset.theme = value, theme);
expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1)).toBe(true);
- const accessibility = await new AxeBuilder({ page }).include('section:has([data-slot="settings-section-title"])').withTags(["wcag2a", "wcag2aa", "wcag21aa"]).analyze();
- expect(accessibility.violations.map(v => ({ id: v.id, targets: v.nodes.map(n => n.target) }))).toEqual([]);
+ const accessibility = await new AxeBuilder({ page }).include('[data-slot="backup-settings"]').withTags(["wcag2a", "wcag2aa", "wcag21aa"]).analyze();
+ expect(accessibility.violations.map(v => ({ id: v.id, targets: v.nodes.map(n => ({ target: n.target, html: n.html, failure: n.failureSummary })) }))).toEqual([]);
checks.push(`backup history/reflow/accessibility ${viewport.width}x${viewport.height} ${theme}`);
if (out) {
await mkdir(out, { recursive: true, mode: 0o700 });
@@ -71,10 +72,17 @@ export async function memoryBackupHistoryJourney(page, fixture) {
const status = await page.evaluate(async () => (await fetch("/api/v1/sys/memory-backup?view=history")).status);
expect(status).toBe(403); checks.push(`real API refuses ${role} before private backup access`);
}
- expect(errors).toEqual([]);
+ expect(errors).toEqual([]); passed = true;
+ } catch (error) {
+ errors.push(error.stack || String(error));
+ if (out) {
+ const file = path.join(out, "memory-backup-history-failure.png");
+ await page.screenshot({ path: file }); screenshots.push(file);
+ }
+ throw error;
} finally {
await fixture.setRole("owner"); await page.unroute(pattern); page.off("pageerror", onError);
- if (out) await writeFile(path.join(out, "memory-backup-history-receipt.json"), JSON.stringify({ at: new Date().toISOString(), environment: "isolated built Settings UI; synthetic backup transport; real role denials", checks, errors, screenshots }, null, 2), { mode: 0o600 });
+ if (out) await writeFile(path.join(out, "memory-backup-history-receipt.json"), JSON.stringify({ at: new Date().toISOString(), environment: "isolated built Settings backup panel; synthetic backup transport; real role denials", passed, checks, errors, screenshots }, null, 2), { mode: 0o600 });
}
console.log(`PASS memory backup history: ${checks.length} viewport/accessibility/pagination/role checks; no host snapshots accessed`);
}
diff --git a/scripts/memory-backup-ui-contract.test.ts b/scripts/memory-backup-ui-contract.test.ts
new file mode 100644
index 00000000..12fde288
--- /dev/null
+++ b/scripts/memory-backup-ui-contract.test.ts
@@ -0,0 +1,19 @@
+import { readFileSync } from "node:fs";
+import { describe, expect, it } from "vitest";
+describe("backup browser proof boundary", () => {
+ it("checks the actual backup panel rather than a shell ancestor containing unrelated windows", () => {
+ const source = readFileSync("frontend/slices/os-settings/components/backup-section.tsx", "utf8");
+ const journey = readFileSync("scripts/e2e/memory-backup-history.mjs", "utf8");
+ expect(source).toContain('data-slot="backup-settings"');
+ expect(journey).toContain(`.include('[data-slot="backup-settings"]')`);
+ expect(journey).toContain(".toHaveCount(1)");
+ expect(journey).not.toContain(".disableRules(");
+ });
+ it("records assertion failures and rethrows them instead of reporting an empty success receipt", () => {
+ const journey = readFileSync("scripts/e2e/memory-backup-history.mjs", "utf8");
+ expect(journey).toContain("passed = false");
+ expect(journey).toContain("errors.push(error.stack || String(error))");
+ expect(journey).toContain("throw error;");
+ expect(journey).toContain("passed, checks, errors, screenshots");
+ });
+});