admin/lib/seo/contentQuality.test.ts
alisaza e1eaf5eff5 feat: initial ghabilee-admin backoffice app
Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js
app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
2026-09-05 13:12:59 +03:30

26 lines
997 B
TypeScript

import { describe, expect, it } from 'vitest'
import { isSeoEligibleEvent } from '@/lib/seo/contentQuality'
describe('SEO event content quality', () => {
it.each([
{ slug: 'generated-ioxehxm8', title: 'رویداد جدید 900' },
{ slug: 'roydad-copy-1785319385289', title: 'رویداد کپی' },
{ slug: 'event-a3f1c9e2', title: 'کارگاه سفال' },
{ slug: 'real-event', title: 'رویداد جدید 42' },
{ slug: 'real-event', title: 'عنوان', shortDescription: 'رویداد تولید شده توسط seed factory' },
])('rejects an obvious placeholder: $slug', (event) => {
expect(isSeoEligibleEvent(event)).toBe(false)
})
it('keeps a descriptive production event', () => {
expect(
isSeoEligibleEvent({
slug: 'tehran-book-club',
title: 'دورهمی کتابخوانی تهران',
shortDescription: 'گفت‌وگوی حضوری درباره کتاب منتخب ماه',
})
).toBe(true)
})
})