Skip to content

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

test: isolate motion preference between browser fixtures

杨嘉伟269fa90a672c
diff --git a/test/motion-governor-browser.test.mjs b/test/motion-governor-browser.test.mjs
index cfa54b76..dc5979bb 100644
--- a/test/motion-governor-browser.test.mjs
+++ b/test/motion-governor-browser.test.mjs
@@ -102,6 +102,12 @@ test('Motion Governor preserves mode, ownership, ambient completion and real cal
assert.ok(navigation.loaderId, 'Motion fixture must load a new document.');
}
await loaded;
+ if (!preserveStorage) {
+ // Chrome's file-backed storage can outlive Storage.clearDataForStorageKey
+ // between fresh fixture navigations. Remove only this test preference
+ // after the new document has loaded so each fixture starts cleanly.
+ await run('localStorage.removeItem("archify-motion")');
+ }
await run('document.fonts.ready');
assert.equal(await run('window.motionNavigation'), expectedNavigation, 'Motion fixture document identity');
}