feat(blog): implement interactive in-article product cards (CAT-P2-10)
Deploy Canina / deploy (push) Successful in 2m15s
Deploy Canina / deploy (push) Successful in 2m15s
This commit is contained in:
1 parent
69094a8646
commit
bb81f2c944
6 files changed
+532
-5
No files matched your search
@@ -143,7 +143,7 @@ describe("BlogPostClient Component", () => {
|
||||
|
||||
// Related Products
|
||||
expect(screen.getByText("مکملهای مرتبط این مقاله")).toBeInTheDocument();
|
||||
expect(screen.getByText("قرص کانیهیدروکس GAG")).toBeInTheDocument();
|
||||
expect(screen.getAllByText("قرص کانیهیدروکس GAG").length).toBeGreaterThan(0);
|
||||
expect(screen.getByText(/۱٬۸۵۰٬۰۰۰ تومان/)).toBeInTheDocument();
|
||||
|
||||
// Related Blogs
|
||||
@@ -281,4 +281,22 @@ describe("BlogPostClient Component", () => {
|
||||
expect(article?.innerHTML).not.toContain('<script');
|
||||
});
|
||||
|
||||
|
||||
it("renders in-article product cards when content has product markers", () => {
|
||||
const contentWithMarker = `<p>توضیحات مهم درباره آرتروز سگها:</p><p>[product canhydrox-gag-tablets]</p><p>توضیحات تکمیلی</p>`;
|
||||
|
||||
render(
|
||||
<BlogPostClient
|
||||
blog={mockBlog}
|
||||
sanitizedContent={contentWithMarker}
|
||||
publishedDate="۱۵ فروردین ۱۴۰۵"
|
||||
authorName="دکتر توماس بکر"
|
||||
/>
|
||||
);
|
||||
|
||||
expect(screen.getByTestId("article-product-card")).toBeInTheDocument();
|
||||
expect(screen.getAllByText("قرص کانیهیدروکس GAG").length).toBeGreaterThan(0);
|
||||
expect(screen.getByText("ضمانت ۱۰۰٪ اصالت آلمان")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
});
|
||||
Reference in new issue
Block a user