admin/lib/seo/hostGuidePage.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
957 B
TypeScript

import { describe, expect, it } from 'vitest'
import { HOST_GUIDE_SEO, HOST_GUIDE_STEPS, hostGuideHowToSchema, hostGuideWebPageSchema } from '@/lib/seo/hostGuidePage'
describe('host guide SEO helpers', () => {
it('keeps host-guide meta within SERP-safe length', () => {
expect(HOST_GUIDE_SEO.metaTitle.length).toBeLessThanOrEqual(60)
expect(HOST_GUIDE_SEO.metaDescription.length).toBeGreaterThanOrEqual(70)
expect(HOST_GUIDE_SEO.metaDescription.length).toBeLessThanOrEqual(160)
})
it('emits WebPage and HowTo schemas with ordered steps', () => {
expect(hostGuideWebPageSchema()).toMatchObject({
'@type': 'WebPage',
inLanguage: 'fa-IR',
url: 'https://ghabilee.ir/host-guide',
})
const howTo = hostGuideHowToSchema()
expect(howTo['@type']).toBe('HowTo')
expect(howTo.step).toHaveLength(HOST_GUIDE_STEPS.length)
expect(howTo.step[0]).toMatchObject({ '@type': 'HowToStep', position: 1 })
})
})