Updated the alert message in the UserEditModal component to improve code readability by formatting the function call across multiple lines. This change enhances maintainability and aligns with the project's coding standards.
38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
import type { AdminEventDetailData } from './types'
|
|
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
import { texts } from '@/texts'
|
|
|
|
import { resolveAdminEventLifecycleHint } from './adminEventLifecycleHints'
|
|
|
|
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
|
|
)
|
|
})
|
|
})
|