fix: reorder visible habits
This commit is contained in:
@@ -750,13 +750,17 @@ describe('task and habit row decoration', () => {
|
||||
expect(css).not.toContain('.habit-toolbar{')
|
||||
})
|
||||
|
||||
it('filters habits with the shared preference and disables sorting while completed items are hidden', () => {
|
||||
it('filters habits with the shared preference while keeping visible habits sortable', () => {
|
||||
expect(mvpPanel).toContain('const visibleTodayHabits = computed(() => props.showCompleted ? todayHabits.value')
|
||||
expect(mvpPanel).toContain('const visibleHabits = computed(() => props.showCompleted ? habits.value')
|
||||
expect(mvpPanel).toContain('v-for="h in visibleTodayHabits"')
|
||||
expect(mvpPanel).toContain('v-for="h in visibleHabits"')
|
||||
expect(mvpPanel).toContain(':disabled="!showCompleted"')
|
||||
expect(mvpPanel).toContain('if (busy.value || !props.showCompleted) return')
|
||||
expect(mvpPanel).not.toContain(':disabled="!showCompleted"')
|
||||
expect(mvpPanel).toContain('if (busy.value) return')
|
||||
expect(mvpPanel).not.toContain('if (busy.value || !props.showCompleted) return')
|
||||
expect(mvpPanel).toContain('const reorderedVisible = moveItemWithinScope(visiblePrevious')
|
||||
expect(mvpPanel).toContain('const next = mergeReorderedSubset(previous, reorderedVisible)')
|
||||
expect(mvpPanel).toContain('habit_ids: reorderedVisible.map((item) => item.id)')
|
||||
expect(css).not.toContain('.habit-toolbar{')
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user