feat(app): editor sidebar hidden below 1 280 px, menu one tap away
AC9: on the draft editor path AppLayout uses the xl class set (sidebar
from 1 280 px, menu button and brand below); other pages keep lg.
AppLayout split: Sidebar and TopBar in ShellChrome.tsx. MobileDrawer
takes closesFrom ('64rem' | '80rem') and also closes at setup when
its query already matches.
Rewritten assertions (R-24):
- shell.AppLayout "opens the mobile drawer" and shell.navigation
"carries the same entries into the mobile drawer": stub a narrow
matchMedia, the drawer now closes at setup at the happy-dom width.
New: unit tests (class sets, 64rem/80rem close, setup close, leave
guard on a drawer link) and editor-shell.spec F journeys (sidebar at
1024/1180/1279/1280, one-tap menu, drawer open at 1180, guard).
This commit is contained in:
1 parent
89da8d3f55
commit
580ff28214
6 files changed
+317
-74
No files matched your search
@@ -80,7 +80,10 @@ beforeEach(() => {
|
||||
avatarUrl: null,
|
||||
})
|
||||
})
|
||||
afterEach(cleanup)
|
||||
afterEach(() => {
|
||||
cleanup()
|
||||
vi.unstubAllGlobals()
|
||||
})
|
||||
|
||||
describe('SidebarNav entries', () => {
|
||||
it('hides both V1-2 entries from an account without a right', () => {
|
||||
@@ -126,6 +129,12 @@ describe('SidebarNav entries', () => {
|
||||
|
||||
it('carries the same entries into the mobile drawer', async () => {
|
||||
const user = userEvent.setup()
|
||||
// A narrow screen: the drawer closes by itself once the sidebar breakpoint matches.
|
||||
vi.stubGlobal('matchMedia', () => ({
|
||||
matches: false,
|
||||
addEventListener: () => {},
|
||||
removeEventListener: () => {},
|
||||
}))
|
||||
mount([grant('sheet_editor')])
|
||||
await user.click(screen.getByRole('button', { name: fr['shell.open_menu'] }))
|
||||
const drawer = await screen.findByRole('dialog', { name: fr['shell.nav_label'] })
|
||||
|
||||
Reference in new issue
Block a user