refactor: clarify sidebar navigation hierarchy
This commit is contained in:
@@ -478,6 +478,39 @@ describe('desktop sidebar collapse & folder scrollbar', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('sidebar information hierarchy', () => {
|
||||
it('keeps daily navigation above lists and low-frequency management at the bottom', () => {
|
||||
const primary = app.slice(app.indexOf('<nav class="primary-nav">'), app.indexOf('</nav>', app.indexOf('<nav class="primary-nav">')))
|
||||
expect(primary).toContain('收集箱')
|
||||
expect(primary).toContain('今天')
|
||||
expect(primary).toContain('最近 7 天')
|
||||
expect(primary).toContain('习惯')
|
||||
expect(primary).toContain('倒数日')
|
||||
expect(primary).not.toContain('回收站')
|
||||
expect(app).toContain('class="sidebar-management"')
|
||||
expect(app).toMatch(/sidebar-management[\s\S]*?switchView\('trash'\)[\s\S]*?回收站[\s\S]*?switchView\('settings'\)[\s\S]*?设置/)
|
||||
})
|
||||
|
||||
it('uses a compact brand row, restrained active marker and a single list creation trigger', () => {
|
||||
expect(app).toContain('class="mini-icon list-create-trigger" aria-label="新建清单或文件夹"')
|
||||
expect(app).not.toContain('aria-label="新建文件夹" @click="createFolder"')
|
||||
expect(css).toContain('.brand-row{height:64px;')
|
||||
expect(css).toContain('.primary-nav button.active::before,.list-row.active::before,.sidebar-management button.active::before{')
|
||||
expect(css).toContain('width:3px;')
|
||||
})
|
||||
|
||||
it('collapses list management actions behind one explicit more button', () => {
|
||||
expect(app).toContain('aria-label="打开文件夹操作"')
|
||||
expect(app).toContain('aria-label="打开清单操作"')
|
||||
expect(app).toContain('class="sidebar-action-mask app-sheet-mask"')
|
||||
expect(app).toContain('class="sidebar-action-sheet app-sheet app-sheet--actions"')
|
||||
expect(app).toContain('@keydown.esc="sidebarCreateOpen=false;closeSidebarAction()"')
|
||||
expect(app).toContain('sidebarCreateOpen.value = false; sidebarAction.value = null')
|
||||
expect(app).not.toContain('aria-label="重命名文件夹" @click="renameEntity')
|
||||
expect(app).not.toContain('aria-label="重命名清单" @click="renameEntity')
|
||||
})
|
||||
})
|
||||
|
||||
describe('sidebar layout', () => {
|
||||
it('switches to the compact layout before the desktop grid can be clipped', () => {
|
||||
expect(css).toContain('@media(max-width:930px){.shell')
|
||||
|
||||
Reference in New Issue
Block a user