fix: refine mobile navigation and settings
This commit is contained in:
@@ -17,6 +17,13 @@ describe('mobile navigation styles', () => {
|
||||
expect(app).toContain('<span>设置</span>')
|
||||
})
|
||||
|
||||
it('marks only exact mobile destinations active and exposes aria-current only there', () => {
|
||||
for (const view of ['today', 'habits', 'countdowns', 'settings']) {
|
||||
expect(app).toContain(`:class="{active:activeView==='${view}'}" :aria-current="activeView==='${view}' ? 'page' : undefined"`)
|
||||
}
|
||||
expect(app).not.toContain("activeView==='tasks'||activeView==='upcoming'||activeView==='trash'||activeView==='settings'")
|
||||
})
|
||||
|
||||
it('keeps the mobile More sheet visible when it is rendered', () => {
|
||||
expect(css).not.toContain('.more-mask{display:none}')
|
||||
expect(css).toContain('@media(max-width:930px){.shell')
|
||||
@@ -31,6 +38,40 @@ describe('mobile navigation styles', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('settings sessions and audit activity', () => {
|
||||
it('renders readable session metadata, local time, and an accessible revoke action', () => {
|
||||
expect(mvpPanel).toContain('class="session-copy"')
|
||||
expect(mvpPanel).toContain('class="session-title"')
|
||||
expect(mvpPanel).toContain('class="session-meta"')
|
||||
expect(mvpPanel).toContain('class="session-device"')
|
||||
expect(mvpPanel).toContain(':datetime="s.last_seen_at ?? s.created_at"')
|
||||
expect(mvpPanel).toContain(':aria-label="`撤销 ${formatUserAgent(s.user_agent)} 的登录会话`"')
|
||||
expect(mvpPanel).toContain('class="danger-text session-revoke"')
|
||||
})
|
||||
|
||||
it('does not expose the raw user agent in session DOM attributes', () => {
|
||||
expect(mvpPanel).not.toContain(':title="s.user_agent || undefined"')
|
||||
expect(mvpPanel).not.toMatch(/<span class="session-device"[^>]*s\.user_agent[^>]*>/)
|
||||
expect(mvpPanel).toContain('<span class="session-device">{{ formatUserAgent(s.user_agent) }}</span>')
|
||||
})
|
||||
|
||||
it('renders localized audit copy and semantic local time', () => {
|
||||
expect(mvpPanel).toContain('class="audit-copy"')
|
||||
expect(mvpPanel).toContain('class="audit-action"')
|
||||
expect(mvpPanel).toContain("formatAuditAction(row.action ?? row.event)")
|
||||
expect(mvpPanel).toContain('formatAuditEntity(row.entity_type)')
|
||||
expect(mvpPanel).toContain(':datetime="row.created_at ?? row.timestamp"')
|
||||
})
|
||||
|
||||
it('keeps revoke and all existing drag handles at 44px without enlarging icons', () => {
|
||||
expect(css).toContain('.drag-handle{width:44px;min-width:44px;height:44px;flex:0 0 44px;')
|
||||
expect(css).toContain('.drag-handle svg{width:17px;height:17px}')
|
||||
expect(css).not.toContain('.drag-handle{width:36px;flex-basis:36px}')
|
||||
expect(css).toContain('.session-copy{min-width:0;flex:1;')
|
||||
expect(css).toContain('.session-revoke{min-width:44px;min-height:44px;flex:0 0 auto;')
|
||||
})
|
||||
})
|
||||
|
||||
describe('solid cream material system', () => {
|
||||
it('defines three opaque cream surfaces, warm borders, restrained depth, and the radius scale', () => {
|
||||
expect(css).toContain('--surface-canvas:#f6f0e5')
|
||||
|
||||
Reference in New Issue
Block a user