Skip to content

Commit fd2011e

Browse files
committed
test(app-shell): an app's docs pages are no top-bar exception from 768 px up
Claude-Session: https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2ec4312 commit fd2011e

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎ui/packages/app-shell/src/layout/__tests__/ConsoleLayout.noTopBar-36112.test.tsx‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* at the window's top, the standing banners and the connection notice sit at
66
* the top of the content area, the page header carries the sidebar's expand
77
* button while the sidebar is collapsed, and a route with no shell header gets
8-
* that button at the content's corner. A phone keeps its bar, and so does an
9-
* app's docs page, which mounts no sidebar.
8+
* that button at the content's corner. A phone keeps its bar. An app's docs
9+
* pages are no exception from 768 px up (objectstack#37150).
1010
*
1111
* Harness: the real `ConsoleLayout` with its real `@object-ui/layout`
1212
* `AppShell` and the real `ShellPageActionsScope`; the sidebar, the app bar
@@ -106,8 +106,15 @@ describe('an app draws no top bar from 768 px up (objectstack#36112)', () => {
106106
}
107107
});
108108

109-
it('control: an app\'s docs pages, which mount no sidebar, keep the bar at every width', () => {
110-
mountAt('/apps/crm/docs/crm_manual', 1440, <div>Manual</div>);
109+
it('an app\'s docs pages are no exception (objectstack#37150): the sidebar and no bar from 768 px up; a phone keeps the bar', () => {
110+
for (const width of [768, 1440]) {
111+
mountAt('/apps/crm/docs/crm_manual', width, <div>Manual</div>);
112+
expect(document.querySelectorAll('header'), `${width} px`).toHaveLength(0);
113+
expect(screen.queryByTestId('app-bar'), `${width} px`).toBeNull();
114+
expect(screen.getByTestId('sidebar-stub'), `${width} px`).toBeInTheDocument();
115+
cleanup();
116+
}
117+
mountAt('/apps/crm/docs/crm_manual', 390, <div>Manual</div>);
111118
expect(screen.getByTestId('app-bar')).toBeInTheDocument();
112119
expect(screen.queryByTestId('sidebar-stub')).toBeNull();
113120
});

0 commit comments

Comments
 (0)