feat: show progress bars for numeric habits
ci / gitleaks (push) Successful in 6s
ci / docker (push) Successful in 6m24s

This commit is contained in:
2026-09-08 15:51:23 +08:00
parent 7f4ba7779a
commit 3aa988c699
3 changed files with 18 additions and 1 deletions
+8
View File
@@ -120,6 +120,14 @@ describe('task and habit row decoration', () => {
expect(css).toContain('.habit-progress{margin-left:auto;')
})
it('shows an accessible progress bar for numeric habits in both habit views', () => {
expect(mvpPanel.match(/<progress v-if="h.kind === 'numeric'" class="habit-progress-bar"/g)?.length).toBe(2)
expect(mvpPanel.match(/:value="habitProgressValue\(h\)" :max="habitProgressMax\(h\)"/g)?.length).toBe(2)
expect(mvpPanel.match(/:aria-label="`\$\{h.name\}进度:\$\{habitProgressText\(h\)\}`"/g)?.length).toBe(2)
expect(css).toContain('.habit-progress-bar{grid-column:1/-1;')
expect(css).toContain('.habit-progress-bar::-webkit-progress-value{background:linear-gradient')
})
it('restores the current page and list from local storage', () => {
expect(app).toContain("readStoredNavigation(window.localStorage, NAVIGATION_STORAGE_KEY)")
expect(app).toContain("writeStoredNavigation(window.localStorage, NAVIGATION_STORAGE_KEY, view, activeList.value)")