import { expect, test } from "@playwright/test"; import { editCreatedSkillThroughStudio } from "./skill-studio-flow.js"; for (const hydrationMs of [0, 1500]) test(`Studio preserves the loaded file before editing (${hydrationMs}ms hydration)`, async ({ page }) => { const skillId = "owned-skill", skillName = "owned-qa-skill", marker = "Studio edit marker: owned-campaign"; let saved = "Verify checks.", saves = 0; await page.exposeFunction("saveSkill", (body: string) => { saved = body; saves++; }); await page.route("https://fixture.test/**", async route => { const studio = new URL(route.request().url()).pathname.includes("/skills/studio/"); const body = studio ? `
` : `${line}
`).join("")} Open in Skill StudioVerify checks.
Open in Skill StudioNo skill card
" })); await page.goto("https://fixture.test/QA/issues/QA-1?token=private-fixture-value"); const failure = await editCreatedSkillThroughStudio({ page, skillId: "owned", skillName: "private-skill-name", marker: "private-marker", deadlineAt: Date.now() + 7000, read: async () => ({}) }).catch(error => error); expect(failure).toMatchObject({ outcome: "failed", code: "skill_studio_open_card_failed", message: "skill_studio_open_card_failed" }); expect(JSON.stringify(failure)).not.toMatch(/private|fixture.test|token=/); });