Enhanced various components to utilize the alert modal for user confirmations before executing critical actions. This includes marking messages as read, saving notification rules, restoring reviews, sending replies, changing ticket statuses, and managing event commissions. The integration improves user experience by ensuring actions are intentional and provides clear feedback on the outcomes.
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import type { AdminEventDetailData } from './types'
|
|
|
|
import { resolveAdminEventLifecycleHint } from './adminEventLifecycleHints'
|
|
import { texts } from '@/texts'
|
|
|
|
const baseEvent = {
|
|
id: 'event-1',
|
|
adminApprovedAt: null,
|
|
bookedCount: 0,
|
|
} as AdminEventDetailData
|
|
|
|
describe('resolveAdminEventLifecycleHint', () => {
|
|
it('explains approve vs force-publish on unapproved drafts', () => {
|
|
expect(resolveAdminEventLifecycleHint({ ...baseEvent, status: 'draft', adminApprovedAt: null })).toBe(
|
|
texts.events.adminLifecycleHintDraftUnapproved
|
|
)
|
|
})
|
|
|
|
it('explains waiting on the host after admin approval', () => {
|
|
expect(resolveAdminEventLifecycleHint({ ...baseEvent, status: 'draft', adminApprovedAt: '2026-01-01T00:00:00.000Z' })).toBe(
|
|
texts.events.adminLifecycleHintDraftApproved
|
|
)
|
|
})
|
|
|
|
it('explains pending-review approval', () => {
|
|
expect(resolveAdminEventLifecycleHint({ ...baseEvent, status: 'pending_review' })).toBe(texts.events.adminLifecycleHintPendingReview)
|
|
})
|
|
|
|
it('explains complete and cancel on live events', () => {
|
|
expect(resolveAdminEventLifecycleHint({ ...baseEvent, status: 'published', bookedCount: 2 })).toBe(texts.events.adminLifecycleHintPublished)
|
|
})
|
|
})
|