From fcce530fa4b8248a40c04e7d9242c34e819d0dfc Mon Sep 17 00:00:00 2001 From: Seth <40871381+sethalan@users.noreply.github.com> Date: Sat, 5 Dec 2026 23:12:23 -0800 Subject: [PATCH] Make the frame page test Notebook tab through the server route, which keys folders as macOS does AI Assisted --- scripts/test-web-console-page-frame.mjs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/test-web-console-page-frame.mjs b/scripts/test-web-console-page-frame.mjs index 766a884..49248b9 100644 --- a/scripts/test-web-console-page-frame.mjs +++ b/scripts/test-web-console-page-frame.mjs @@ -12,7 +12,6 @@ import test from "node:test"; import assert from "node:assert/strict"; import { pageSuite, openSession, drawn } from "./page-test-helpers.mjs"; import { until, HOME } from "./web-console-test-helpers.mjs"; -import { createTab, listTabs } from "../src/web-console/notepads.mjs"; const suite = pageSuite(test); @@ -34,7 +33,6 @@ test("under the frame's prefix, with no cookie, the dashboard draws, its stream t.after(() => fs.rmSync(LOOKS_FILE, { force: true })); const browser = await suite.browser(); const s = await openSession(browser, { t, workflow: "dashboard", env: FRAME_ENV }); - if (!listTabs(s.project).tabs.length) createTab(s.project, "Notes"); const signIn = new URL(s.url); const token = /^\/s\/([^/]+)\/$/.exec(signIn.pathname)[1]; @@ -65,6 +63,15 @@ test("under the frame's prefix, with no cookie, the dashboard draws, its stream const res = await page.goto(signIn.origin + prefix, { waitUntil: "domcontentloaded" }); assert.equal(res.status(), 200, "the page itself, under the prefix"); await drawn(page); + // A Notebook tab to open, made through the server's own route from the page: + // the server here believes it runs on macOS, where a folder's notepad key is + // lowercased (foldKey), so a tab this test process made on Linux would sit + // under another key and the Notebook would open empty and read-only. + const made = await page.evaluate(async () => { + const res = await fetch("notepad/tab", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ name: "Notes" }) }); + return res.status; + }); + assert.equal(made, 200, "a Notebook tab, made under the prefix"); // Past Planny's wake-up, to the menu. const skip = page.getByRole("button", { name: "Skip the intro" }); await skip.click();