fix: restore numeric habit progress bars
ci / gitleaks (push) Successful in 9s
ci / docker (push) Successful in 3m34s

This commit is contained in:
2026-09-20 06:41:57 +08:00
parent 4973d56a64
commit 0fb98e894e
5 changed files with 47 additions and 12 deletions
+5 -2
View File
@@ -921,8 +921,11 @@ describe('task and habit row decoration', () => {
expect(mvpPanel).not.toMatch(/today-habit-list[\s\S]*?habit-drag-handle[\s\S]*?<!-- 完整习惯列表 -->/)
})
it('uses the same visible text status tail in Today and full habits', () => {
expect(mvpPanel).not.toContain('<progress v-if="h.kind === \'numeric\'" class="habit-progress-bar"')
it('shows independently accessible progress tracks for numeric habits in Today and full habits', () => {
expect(mvpPanel.match(/<progress v-if="h.kind === 'numeric'" class="habit-progress-bar"/g)?.length).toBe(2)
expect(mvpPanel.match(/:value="habitProgressValue\(h\)"/g)?.length).toBe(2)
expect(mvpPanel.match(/:max="habitProgressMax\(h\)"/g)?.length).toBe(2)
expect(mvpPanel.match(/<\/div>\n\s*<progress v-if="h.kind === 'numeric'" class="habit-progress-bar"/g)?.length).toBe(2)
expect(mvpPanel.match(/class="habit-row-meta"/g)?.length).toBe(2)
expect(mvpPanel.match(/:aria-label="habitRowStatus\(h\)"/g)?.length).toBe(2)
expect(mvpPanel).not.toContain('class="habit-state-note"')