fix: separate today completion toolbar
ci / gitleaks (push) Successful in 6s
ci / docker (push) Successful in 3m26s

This commit is contained in:
2026-09-10 11:13:21 +08:00
parent c8b0c89944
commit 1bc481d2e4
2 changed files with 11 additions and 1 deletions
File diff suppressed because one or more lines are too long
+10
View File
@@ -440,6 +440,16 @@ describe('task and habit row decoration', () => {
expect(todayHabits).not.toContain('隐藏已完成') expect(todayHabits).not.toContain('隐藏已完成')
}) })
it('adds top spacing only to the Today completed toolbar before mobile overrides', () => {
const todayToolbarRule = '.today-completed-toolbar{margin-top:8px}'
const todayToolbarIndex = css.indexOf(todayToolbarRule)
const mobileBreakpointIndex = css.indexOf('@media(max-width:930px)')
expect(css.match(/\.today-completed-toolbar\{/g)).toHaveLength(1)
expect(todayToolbarIndex).toBeGreaterThan(css.indexOf('.list-toolbar{'))
expect(todayToolbarIndex).toBeLessThan(mobileBreakpointIndex)
expect(css.slice(mobileBreakpointIndex)).not.toContain('.today-completed-toolbar{')
})
it('filters habits with the shared preference and disables sorting while completed items are hidden', () => { it('filters habits with the shared preference and disables sorting while completed items are hidden', () => {
expect(mvpPanel).toContain('const visibleTodayHabits = computed(() => props.showCompleted ? todayHabits.value') expect(mvpPanel).toContain('const visibleTodayHabits = computed(() => props.showCompleted ? todayHabits.value')
expect(mvpPanel).toContain('const visibleHabits = computed(() => props.showCompleted ? habits.value') expect(mvpPanel).toContain('const visibleHabits = computed(() => props.showCompleted ? habits.value')