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
Chore App Build, Test, and Push Docker Images / build-and-push (push) Has been cancelled
This commit is contained in:
@@ -285,4 +285,43 @@ test.describe('Dialog help button and titles', () => {
|
||||
await expect(modalBackdrop(page)).not.toBeVisible({ timeout: 3000 })
|
||||
await expect(helpButton(page)).toBeVisible({ timeout: 5000 })
|
||||
})
|
||||
|
||||
test('help button replays the full tutorial chain when tutorial tips are disabled', async ({
|
||||
page,
|
||||
request,
|
||||
}) => {
|
||||
await setTutorialEnabled(request, false)
|
||||
await resetTutorialProgress(request)
|
||||
|
||||
await page.goto(`/parent/${childId}`)
|
||||
await expect(page.getByText(CHILD_NAME, { exact: true }).first()).toBeVisible({ timeout: 10000 })
|
||||
await expect(page.locator('.tutorial-root .card')).not.toBeVisible()
|
||||
await expect(helpButton(page)).toBeVisible({ timeout: 5000 })
|
||||
|
||||
await helpButton(page).click()
|
||||
|
||||
const cardTitle = page.locator('.tutorial-root .card .title')
|
||||
await expect(cardTitle).toHaveText("This is your child's page")
|
||||
|
||||
await page.locator('.tutorial-root .btn-primary').click()
|
||||
await expect(cardTitle).toHaveText('Assign chores')
|
||||
|
||||
await page.locator('.tutorial-root .btn-primary').click()
|
||||
await expect(cardTitle).toHaveText('Assign kindness acts')
|
||||
|
||||
await page.locator('.tutorial-root .btn-primary').click()
|
||||
await expect(cardTitle).toHaveText('Assign rewards')
|
||||
|
||||
await page.locator('.tutorial-root .btn-primary').click()
|
||||
await expect(cardTitle).toHaveText('Assign routines')
|
||||
|
||||
await page.locator('.tutorial-root .btn-primary').click()
|
||||
await expect(cardTitle).toHaveText('Assign penalties')
|
||||
|
||||
await page.locator('.tutorial-root .btn-primary').click()
|
||||
await expect(cardTitle).toHaveText('Quick actions')
|
||||
|
||||
await page.locator('.tutorial-root .btn-primary').click()
|
||||
await expect(page.locator('.tutorial-root .card')).not.toBeVisible()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user