Skip to content

Commit d4934f2

Browse files
committed
test(web): align mobile and preview expectations
1 parent 816fbe5 commit d4934f2

3 files changed

Lines changed: 23 additions & 20 deletions

File tree

packages/web/src/features/workspace/views/mobile/mobile-explorer-panel.test.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ describe("MobileExplorerPanel", () => {
167167
expect(onSelectFile).toHaveBeenCalledWith("README.md");
168168
});
169169

170-
it("renders shared open editor controls on mobile and closing the active row selects the next file", () => {
170+
it("renders shared open editor controls on mobile and closing the active row exits editor focus", () => {
171171
const onSelectFile = vi.fn();
172172
const store = createStore();
173173
store.set(fileTreeAtomFamily("ws-test"), new Map([[".", []]]));
@@ -227,13 +227,14 @@ describe("MobileExplorerPanel", () => {
227227
})
228228
);
229229

230-
expect(within(section).getByRole("button", { name: "src/beta.tsx" })).toHaveClass(
230+
expect(within(section).getByRole("button", { name: "src/beta.tsx" })).not.toHaveClass(
231231
"workspace-open-editors__item--active"
232232
);
233233
expect(within(section).queryByRole("button", { name: "src/alpha.tsx" })).toBeNull();
234234
expect(heading).toHaveTextContent(/(Open Editors|)\s*\(1\)/i);
235235
expect(Object.keys(store.get(openFilesAtomFamily("ws-test")))).toEqual(["src/beta.tsx"]);
236-
expect(store.get(activeFilePathAtomFamily("ws-test"))).toBe("src/beta.tsx");
236+
expect(store.get(activeFilePathAtomFamily("ws-test"))).toBeNull();
237+
expect(onSelectFile).not.toHaveBeenCalled();
237238
});
238239

239240
it("renders workspace actions inside the Workspace section and wires mobile callbacks", () => {

packages/web/src/shells/mobile-shell/index.test.tsx

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,24 +1705,26 @@ describe("MobileShell Phase 2 workspace", () => {
17051705
},
17061706
undefined
17071707
);
1708-
expect(sendCommand).toHaveBeenCalledWith(
1709-
"workspace.uiState.set",
1710-
expect.objectContaining({
1711-
workspaceId: "ws-1",
1712-
uiState: expect.objectContaining({
1713-
activeSessionId: "sess_3",
1714-
paneLayout: expect.objectContaining({
1715-
type: "split",
1716-
direction: "vertical",
1717-
children: [
1718-
expect.objectContaining({ sessionId: "sess_2" }),
1719-
expect.objectContaining({ sessionId: "sess_3" }),
1720-
],
1708+
await waitFor(() => {
1709+
expect(sendCommand).toHaveBeenCalledWith(
1710+
"workspace.uiState.set",
1711+
expect.objectContaining({
1712+
workspaceId: "ws-1",
1713+
uiState: expect.objectContaining({
1714+
activeSessionId: "sess_3",
1715+
paneLayout: expect.objectContaining({
1716+
type: "split",
1717+
direction: "horizontal",
1718+
children: [
1719+
expect.objectContaining({ sessionId: "sess_2" }),
1720+
expect.objectContaining({ sessionId: "sess_3" }),
1721+
],
1722+
}),
17211723
}),
17221724
}),
1723-
}),
1724-
undefined
1725-
);
1725+
undefined
1726+
);
1727+
});
17261728
});
17271729

17281730
it("closes the agent sheet once when selecting an existing session", async () => {

packages/web/src/ui-preview/scenes/showcase-scenes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ const readmeDesktopGitStatus: GitStatus = {
173173
headSubject: "feat: stage readme screenshot refresh scenes",
174174
staged: [{ path: "README.md", status: "modified" }],
175175
modified: [
176-
{ path: "packages/web/src/ui-preview/scenes/showcase-scenes.tsx", status: "modified" },
176+
{ path: "packages/web/src/features/topbar/index.tsx", status: "modified" },
177177
{ path: "docs/help/assets/screenshot-desktop-workspace-full.png", status: "modified" },
178178
],
179179
untracked: [{ path: "docs/help/assets/screenshot-mobile-progress.png", status: "untracked" }],

0 commit comments

Comments
 (0)