feat: show progress bars for numeric habits
This commit is contained in:
@@ -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)")
|
||||
|
||||
Reference in New Issue
Block a user