Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
18 lines
757 B
TypeScript
18 lines
757 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { renderNotificationActionUrlPreview, renderNotificationTemplate } from '@/lib/notificationTemplate'
|
|
|
|
describe('notification template preview', () => {
|
|
it('substitutes sample variables and leaves unknown placeholders visible', () => {
|
|
expect(
|
|
renderNotificationTemplate('رزرو شما برای «{{eventTitle}}» تأیید شد {{missing}}', {
|
|
eventTitle: 'دورهمی آخر هفته',
|
|
})
|
|
).toBe('رزرو شما برای «دورهمی آخر هفته» تأیید شد {{missing}}')
|
|
})
|
|
|
|
it('encodes action URL sample values', () => {
|
|
expect(renderNotificationActionUrlPreview('/bookings/{{bookingId}}', { bookingId: 'a/b' })).toBe('/bookings/a%2Fb')
|
|
})
|
|
})
|