This commit is contained in:
@@ -30,6 +30,22 @@ describe('task and habit row decoration', () => {
|
||||
expect(mvpPanel.match(/@pointercancel="cancelHabitPointer/g)?.length).toBe(2)
|
||||
})
|
||||
|
||||
it('updates habit rows locally after swiping instead of refreshing the whole Today section', () => {
|
||||
expect(mvpPanel).toContain('setLocalHabitValue(h, next)')
|
||||
const applyBlock = mvpPanel.slice(mvpPanel.indexOf('async function applyHabitSwipe'), mvpPanel.indexOf('async function finishHabitSwipe'))
|
||||
expect(applyBlock).not.toContain('await loadHabits()')
|
||||
expect(applyBlock).toContain('setLocalHabitValue(h, next)')
|
||||
expect(applyBlock).toContain('setLocalHabitValue(h, previous)')
|
||||
})
|
||||
|
||||
it('keeps swipe behavior without rendering the swipe background layer', () => {
|
||||
expect(app).not.toContain('swipe-bg')
|
||||
expect(mvpPanel).not.toContain('swipe-bg')
|
||||
expect(css).not.toContain('.swipe-bg')
|
||||
expect(app).toContain('shouldToggleRowSwipe')
|
||||
expect(mvpPanel).toContain('shouldToggleRowSwipe')
|
||||
})
|
||||
|
||||
it('does not draw a left border on task or habit rows', () => {
|
||||
expect(css).toContain('.task-row{border-left:0;')
|
||||
expect(css).toContain('.habit-row{border-left:0;')
|
||||
|
||||
Reference in New Issue
Block a user