Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 3m12s
- Changed "Skip tour" button to "Cancel" in various tutorial overlays. - Updated modal titles from "Confirm Task" to "Confirm Penalty" where applicable. - Modified tutorial step call-to-action labels from "Got it" and "Next" to "Continue" for consistency. - Added tests for new tutorial overlay behavior and button interactions. - Refactored tutorial controller to allow ignoring tutorial enabled state in step visibility checks. - Enhanced user profile tutorial restart functionality with appropriate modal messages. - Updated user profile and task confirmation dialog components to reflect new titles and messages. - Adjusted configuration files for local development environments.
60 lines
1.7 KiB
TypeScript
60 lines
1.7 KiB
TypeScript
import { describe, it, expect } from 'vitest'
|
|
import { mount } from '@vue/test-utils'
|
|
import TaskConfirmDialog from '../TaskConfirmDialog.vue'
|
|
import type { Task } from '@/common/models'
|
|
|
|
const ModalDialogStub = {
|
|
template: '<div><slot /></div>',
|
|
props: ['title', 'subtitle', 'imageUrl'],
|
|
}
|
|
|
|
describe('TaskConfirmDialog', () => {
|
|
it('renders "Confirm Task" title for chores', () => {
|
|
const task: Task = {
|
|
id: 'task-1',
|
|
name: 'Clean Room',
|
|
type: 'chore',
|
|
points: 5,
|
|
image_id: '',
|
|
}
|
|
const wrapper = mount(TaskConfirmDialog, {
|
|
props: { task, childName: 'Test Child' },
|
|
global: { stubs: { ModalDialog: ModalDialogStub } },
|
|
})
|
|
|
|
expect(wrapper.findComponent(ModalDialogStub).props('title')).toBe('Confirm Task')
|
|
})
|
|
|
|
it('renders "Confirm Act" title for kindness acts', () => {
|
|
const task: Task = {
|
|
id: 'task-2',
|
|
name: 'Share Toys',
|
|
type: 'kindness',
|
|
points: 3,
|
|
image_id: '',
|
|
}
|
|
const wrapper = mount(TaskConfirmDialog, {
|
|
props: { task, childName: 'Test Child' },
|
|
global: { stubs: { ModalDialog: ModalDialogStub } },
|
|
})
|
|
|
|
expect(wrapper.findComponent(ModalDialogStub).props('title')).toBe('Confirm Act')
|
|
})
|
|
|
|
it('renders "Confirm Penalty" title for penalties', () => {
|
|
const task: Task = {
|
|
id: 'task-3',
|
|
name: 'No Screen Time',
|
|
type: 'penalty',
|
|
points: 5,
|
|
image_id: '',
|
|
}
|
|
const wrapper = mount(TaskConfirmDialog, {
|
|
props: { task, childName: 'Test Child' },
|
|
global: { stubs: { ModalDialog: ModalDialogStub } },
|
|
})
|
|
|
|
expect(wrapper.findComponent(ModalDialogStub).props('title')).toBe('Confirm Penalty')
|
|
})
|
|
})
|