Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
30 lines
962 B
TypeScript
30 lines
962 B
TypeScript
import { describe, expect, it } from 'vitest'
|
||
|
||
import {
|
||
formatEventCardClockLabel,
|
||
formatEventCardDateLabel,
|
||
formatEventCardPriceLabel,
|
||
formatEventCardTimeRange,
|
||
} from '@/features/events/eventCardLabels'
|
||
import { texts } from '@/texts'
|
||
|
||
describe('eventCardLabels', () => {
|
||
it('formats weekday/long date and clock labels', () => {
|
||
const iso = '2030-07-01T10:30:00.000Z'
|
||
|
||
expect(formatEventCardDateLabel(iso)).toContain('تیر')
|
||
expect(formatEventCardClockLabel(iso).length).toBeGreaterThan(0)
|
||
})
|
||
|
||
it('formats a start–end time range', () => {
|
||
const label = formatEventCardTimeRange('2030-07-01T10:00:00.000Z', '2030-07-01T14:00:00.000Z')
|
||
|
||
expect(label).toContain('تا')
|
||
})
|
||
|
||
it('formats free vs paid price labels', () => {
|
||
expect(formatEventCardPriceLabel({ isFree: true, price: 0 })).toBe(texts.events.free)
|
||
expect(formatEventCardPriceLabel({ isFree: false, price: 150_000 })).not.toBe(texts.events.free)
|
||
})
|
||
})
|