From 3e6a7fea43ec18b325620b01172228e12e0b0f18 Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Tue, 28 Jul 2026 23:04:55 +0800 Subject: [PATCH] test(ui-sidebar): pin the shell chrome with local DOM snapshots First consumer of the runtime's single-slot mounting: the real apply mounts on its own fiber, renderSlot('sidebar', ...) captures exactly the sidebar slot's output, and update() re-renders the collapsed rail in place. The .snap files carry semantic class names and svg fingerprints only. --- packages/client/ui-sidebar/package.json | 1 + .../sidebar-snapshot.spec.tsx.snap | 131 ++++++++++++++++++ .../tests/sidebar-snapshot.spec.tsx | 51 +++++++ 3 files changed, 183 insertions(+) create mode 100644 packages/client/ui-sidebar/tests/__snapshots__/sidebar-snapshot.spec.tsx.snap create mode 100644 packages/client/ui-sidebar/tests/sidebar-snapshot.spec.tsx diff --git a/packages/client/ui-sidebar/package.json b/packages/client/ui-sidebar/package.json index 5f7b4d0f23..7d85b111cf 100644 --- a/packages/client/ui-sidebar/package.json +++ b/packages/client/ui-sidebar/package.json @@ -47,6 +47,7 @@ }, "devDependencies": { "@deepseek-ai/dsh-client-runtime": "workspace:^", + "@deepseek-ai/dsh-client-test-runtime": "workspace:^", "@deepseek-ai/dsh-client-ui-layout": "workspace:^", "@deepseek-ai/dsh-client-ui-primitives": "workspace:^", "@deepseek-ai/dsh-client-ui-slots": "workspace:^", diff --git a/packages/client/ui-sidebar/tests/__snapshots__/sidebar-snapshot.spec.tsx.snap b/packages/client/ui-sidebar/tests/__snapshots__/sidebar-snapshot.spec.tsx.snap new file mode 100644 index 0000000000..6678d3088e --- /dev/null +++ b/packages/client/ui-sidebar/tests/__snapshots__/sidebar-snapshot.spec.tsx.snap @@ -0,0 +1,131 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`sidebar shell snapshots > renders the collapsed rail after the crossfade settles, in place 1`] = ` +
+