|
5 | 5 | * at the window's top, the standing banners and the connection notice sit at |
6 | 6 | * the top of the content area, the page header carries the sidebar's expand |
7 | 7 | * 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). |
10 | 10 | * |
11 | 11 | * Harness: the real `ConsoleLayout` with its real `@object-ui/layout` |
12 | 12 | * `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)', () => { |
106 | 106 | } |
107 | 107 | }); |
108 | 108 |
|
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>); |
111 | 118 | expect(screen.getByTestId('app-bar')).toBeInTheDocument(); |
112 | 119 | expect(screen.queryByTestId('sidebar-stub')).toBeNull(); |
113 | 120 | }); |
|
0 commit comments