refactor: unify mobile list rows
This commit is contained in:
@@ -30,6 +30,27 @@ describe('mobile navigation styles', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('mobile list row language', () => {
|
||||
it('uses one quiet bordered row surface for tasks, habits, and countdowns on mobile', () => {
|
||||
expect(css).toContain('@media(max-width:930px){.task-row,.habit-row,.countdown-row{')
|
||||
expect(css).toMatch(/@media\(max-width:930px\)\{\.task-row,\.habit-row,\.countdown-row\{[^}]*background:#fff;[^}]*border:1px solid var\(--line\);[^}]*border-radius:13px;[^}]*box-shadow:none/)
|
||||
expect(css).toContain('.task-list,.habit-list,.countdown-timeline{display:grid;gap:8px}')
|
||||
expect(css).toContain('.task-main strong,.habit-name,.countdown-main>b{font-size:14px;')
|
||||
expect(css).toContain('.meta,.habit-progress,.countdown-main>small,.countdown-state small{font-size:11px;')
|
||||
})
|
||||
|
||||
it('keeps destructive habit actions in a detail sheet instead of the list row', () => {
|
||||
expect(mvpPanel).not.toContain('<button class="icon ghost" aria-label="归档习惯"')
|
||||
expect(mvpPanel).toContain('class="habit-detail-mask"')
|
||||
expect(mvpPanel).toContain('class="habit-detail-sheet"')
|
||||
expect(mvpPanel).toContain('@click="archiveHabit(selectedHabit)"')
|
||||
expect(mvpPanel).toContain('@click="openHabitDetail(h, $event.currentTarget as HTMLElement)"')
|
||||
expect(mvpPanel).toContain('@keydown.enter.prevent="openHabitDetail(h, $event.currentTarget as HTMLElement)"')
|
||||
expect(mvpPanel).toContain('ref="habitDetailSheet"')
|
||||
expect(mvpPanel).toContain("habitDetailSheet.value?.focus()")
|
||||
})
|
||||
})
|
||||
|
||||
describe('task and habit row decoration', () => {
|
||||
it('removes the redundant habit refresh action', () => {
|
||||
expect(mvpPanel).not.toContain('<RefreshCw />刷新')
|
||||
|
||||
Reference in New Issue
Block a user