fix: persist completed item visibility
This commit is contained in:
@@ -120,8 +120,15 @@ describe('task and habit row decoration', () => {
|
||||
expect(css).toContain('.habit-progress{margin-left:auto;')
|
||||
})
|
||||
|
||||
it('restores the completed-item visibility choices from local storage', () => {
|
||||
expect(app).toContain("readStoredBoolean(window.localStorage, SHOW_COMPLETED_STORAGE_KEY, true)")
|
||||
expect(app).toContain("writeStoredBoolean(window.localStorage, SHOW_COMPLETED_STORAGE_KEY, value)")
|
||||
expect(mvpPanel).toContain("readStoredBoolean(window.localStorage, HIDE_COMPLETED_HABITS_STORAGE_KEY, false)")
|
||||
expect(mvpPanel).toContain("writeStoredBoolean(window.localStorage, HIDE_COMPLETED_HABITS_STORAGE_KEY, value)")
|
||||
})
|
||||
|
||||
it('can hide completed habits in both Today and full habit views', () => {
|
||||
expect(mvpPanel).toContain('const hideCompletedHabits = ref(false)')
|
||||
expect(mvpPanel).toContain("const hideCompletedHabits = ref(readStoredBoolean(window.localStorage, HIDE_COMPLETED_HABITS_STORAGE_KEY, false))")
|
||||
expect(mvpPanel).toContain('const visibleTodayHabits = computed')
|
||||
expect(mvpPanel).toContain('const visibleHabits = computed')
|
||||
expect(mvpPanel).toContain('v-model="hideCompletedHabits"')
|
||||
|
||||
Reference in New Issue
Block a user