feat(tutorial): update tutorial labels and modal titles to improve clarity
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 3m12s
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.
This commit is contained in:
@@ -34,16 +34,17 @@ vi.mock('../services/pushSubscription', () => ({
|
||||
getPushPermissionState: vi.fn().mockReturnValue('default'),
|
||||
}))
|
||||
|
||||
function stubUserProfile() {
|
||||
return {
|
||||
template: '<div class="user-profile"><slot /></div>',
|
||||
}
|
||||
}
|
||||
const mockResetAllProgress = vi.fn().mockResolvedValue(undefined)
|
||||
vi.mock('@/tutorial/controller', () => ({
|
||||
tutorialEnabled: { value: true },
|
||||
setTutorialEnabled: vi.fn(),
|
||||
resetAllProgress: () => mockResetAllProgress(),
|
||||
}))
|
||||
|
||||
function stubModalDialog() {
|
||||
return {
|
||||
template: '<div class="mock-modal" v-if="show"><slot /></div>',
|
||||
props: ['show'],
|
||||
template: '<div class="mock-modal"><h2 v-if="title">{{ title }}</h2><slot /></div>',
|
||||
props: ['title'],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -607,3 +608,64 @@ describe('UserProfile - Notification Toggles', () => {
|
||||
expect(body.push_notifications_enabled).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('UserProfile - Tutorial restart', () => {
|
||||
let wrapper: VueWrapper<any>
|
||||
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks()
|
||||
mockResetAllProgress.mockClear()
|
||||
;(global.fetch as any).mockClear()
|
||||
;(global.fetch as any).mockResolvedValue({
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
image_id: null,
|
||||
first_name: 'Test',
|
||||
last_name: 'User',
|
||||
email: 'test@example.com',
|
||||
email_digest_enabled: true,
|
||||
}),
|
||||
})
|
||||
|
||||
wrapper = mount(UserProfile, {
|
||||
global: {
|
||||
plugins: [mockRouter],
|
||||
stubs: {
|
||||
ProfileSection: stubProfileSection(),
|
||||
ImagePicker: stubImagePicker(),
|
||||
ToggleField: stubToggleField(),
|
||||
ModalDialog: stubModalDialog(),
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
it('restart confirm modal uses "Tutorial Restart" title and explanatory wording', async () => {
|
||||
await flushPromises()
|
||||
await nextTick()
|
||||
|
||||
await wrapper.vm.openRestartConfirm()
|
||||
await nextTick()
|
||||
|
||||
const modal = wrapper.find('.mock-modal')
|
||||
expect(modal.exists()).toBe(true)
|
||||
expect(modal.text()).toContain('Tutorial Restart')
|
||||
expect(modal.text()).toContain('Start the tour again')
|
||||
})
|
||||
|
||||
it('confirming restart resets tutorial progress and shows success modal', async () => {
|
||||
await flushPromises()
|
||||
await nextTick()
|
||||
|
||||
await wrapper.vm.openRestartConfirm()
|
||||
await wrapper.vm.confirmRestartTutorial()
|
||||
await flushPromises()
|
||||
await nextTick()
|
||||
|
||||
expect(mockResetAllProgress).toHaveBeenCalledTimes(1)
|
||||
|
||||
const modal = wrapper.find('.mock-modal')
|
||||
expect(modal.text()).toContain('Tutorial Restart')
|
||||
expect(modal.text()).toContain('Tutorial mode has been restarted')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user