feat(tutorial): enhance tutorial flow and add tests for help button functionality
Chore App Build, Test, and Push Docker Images / build-and-push (push) Has been cancelled

This commit is contained in:
2026-07-25 23:59:51 -04:00
parent 8e4f89f4ec
commit 96992cf918
8 changed files with 174 additions and 18 deletions
@@ -0,0 +1,48 @@
import { describe, it, expect, beforeEach } from 'vitest'
import {
shouldShowStep,
clearChainProgress,
tutorialEnabled,
tutorialProgress,
sessionSkipped,
} from '../controller'
describe('tutorial controller - shouldShowStep', () => {
beforeEach(() => {
tutorialEnabled.value = true
tutorialProgress.value = {}
sessionSkipped.value = false
})
it('returns true when tips are enabled, the step is unseen, and the session is not skipped', () => {
expect(shouldShowStep('create-chore')).toBe(true)
})
it('returns false when tips are disabled for a normal step', () => {
tutorialEnabled.value = false
expect(shouldShowStep('create-penalty')).toBe(false)
})
it('returns true for a locally-cleared step even when tips are disabled', () => {
tutorialEnabled.value = false
clearChainProgress('create-reward')
expect(shouldShowStep('create-reward')).toBe(true)
})
it('still blocks locally-cleared steps when the session has been skipped', () => {
tutorialEnabled.value = false
sessionSkipped.value = true
clearChainProgress('create-kindness')
expect(shouldShowStep('create-kindness')).toBe(false)
})
it('returns false when the step has already been seen', () => {
tutorialProgress.value = { 'notification-click': true }
expect(shouldShowStep('notification-click')).toBe(false)
})
it('ignores the enabled flag when ignoreEnabled is true', () => {
tutorialEnabled.value = false
expect(shouldShowStep('status-pending', true)).toBe(true)
})
})