Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions scripts/verify/e2e/cases/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1316,10 +1316,23 @@ export const workspaceCases: E2ECase[] = [
}
return value;
};
// The outgoing document can flush its in-memory chrome state
// during teardown and clobber the seed before the new document
// reads it (same persist race as UC-E01 restore, #845). Verify
// the file still holds the seed after boot and retry once.
const seedCollapsedAndReload = async (
collapsed: boolean,
): Promise<LiveSurface> => {
for (let attempt = 0; ; attempt++) {
await seedCollapsed(collapsed);
const panel = await reloadPanel1(ctx, 45_000);
const settled = await waitFileCollapsed(collapsed);
if (settled === collapsed || attempt === 1) return panel;
}
};

await withManagedRootSnapshot(ctx, "uc-b09-cp-collapse", async () => {
await seedCollapsed(true);
const panel = await reloadPanel1(ctx, 45_000);
const panel = await seedCollapsedAndReload(true);

const cpSeen = await waitForDom(
ctx,
Expand Down Expand Up @@ -1397,11 +1410,10 @@ export const workspaceCases: E2ECase[] = [
// Round-trip the other direction through persistence: re-seed
// collapsed and confirm boot restores it (the collapse action
// itself is a native context-menu path, not DOM-addressable).
await seedCollapsed(true);
await reloadPanel1(ctx, 45_000);
const reseeded = await seedCollapsedAndReload(true);
const recollected = await waitForDom(
ctx,
panel,
reseeded,
`(() => {
const cp = document.querySelector("[data-cp]");
return cp && cp.getAttribute("data-collapsed") === "true";
Expand All @@ -1412,7 +1424,7 @@ export const workspaceCases: E2ECase[] = [
check(
"re-seeded collapsed state survives reload",
Boolean(recollected),
await domCollapsed(panel),
await domCollapsed(reseeded),
),
);
});
Expand Down
Loading