feat(blog): add material freshness and authorship

This commit is contained in:
devops committed 2026-10-20 05:36:03 +00:00
1 parent 3f5258a76c
commit 51ca8c7e34
24 files changed
+187 -52

No files matched your search

@@ -89,7 +89,7 @@ describe("BlogPostClient Component", () => {
// Breadcrumb and headers
expect(screen.getByRole("heading", { level: 1, name: /راهنمای جامع کانی‌هیدروکس GAG/ })).toBeInTheDocument();
expect(screen.getAllByText("سلامت استخوان و مفاصل").length).toBeGreaterThan(0);
expect(screen.getByText("دکتر توماس بکر")).toBeInTheDocument();
expect(screen.getByText("نویسنده: دکتر توماس بکر")).toBeInTheDocument();
expect(screen.getByText("۱۵ فروردین ۱۴۰۵")).toBeInTheDocument();
expect(screen.getAllByText(/دقیقه مطالعه/).length).toBeGreaterThan(0);
@@ -110,6 +110,15 @@ describe("BlogPostClient Component", () => {
expect(screen.getByText("بسته‌بندی قوطی کانی‌هیدروکس")).toBeInTheDocument();
});
it("renders semantic publication, valid update and explicit author/team labels", () => {
render(<BlogPostClient blog={{...mockBlog,publishedAt:"2026-01-01T00:00:00Z",contentUpdatedAt:"2026-01-02T00:00:00Z",authorTeam:"Science"}} sanitizedContent={mockBlog.content} publishedDate="۱۲ دی ۱۴۰۴" authorName="دکتر بکر" />);
expect(screen.getByText(/تاریخ انتشار/)).toBeInTheDocument();
expect(screen.getByText(/آخرین به‌روزرسانی/)).toBeInTheDocument();
expect(screen.getByText(/نویسنده: دکتر بکر/)).toBeInTheDocument();
expect(screen.getByText(/تیم: Science/)).toBeInTheDocument();
expect(document.querySelectorAll("time[datetime]").length).toBe(2);
});
it("registers blog view count on mount via API", async () => {
render(
<BlogPostClient