Files
canina/frontend/application/app/blog/[slug]/timestamp-visible.test.tsx
T

18 lines
960 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import React from 'react';
import { renderToStaticMarkup } from 'react-dom/server';
import { expect, it } from 'vitest';
import BlogPostClient from '../../../components/BlogPostClient';
it.each([null, undefined, 'invalid', '2026-10-29T07:11:40.925Z', '2026-10-28T00:00:00Z'])(
'actual client keeps publication but no visible update for %s despite later technical writes', (contentUpdatedAt) => {
const html = renderToStaticMarkup(<BlogPostClient
blog={{ id: 'timestamp-fixture', slug: 'timestamp-fixture', title: 'Timestamp',
publishedAt: '2026-10-29T07:11:40.925Z', contentUpdatedAt,
updatedAt: '2026-10-30T10:00:00Z', imageUrl: '/attached.webp' }}
publishedDate="۱۴۰۵/۸/۷" sanitizedContent="<p>Article</p>" authorName="کنینا"
/>);
expect(html).toContain('تاریخ انتشار');
expect(html).toContain('۱۴۰۵/۸/۷');
expect(html).not.toContain('آخرین به‌روزرسانی');
});