Files
hamed 9cfbd2e002 feat: Revert homepage changes, fix Persian slug 404, and make various article and about us adjustments
- Removed the newly added city-focused section from the homepage.
- Fixed 404 error for Persian slugs in specialties and blog pages by implementing a decode helper.
- Removed the "مخصوص شهر" label from article headers.
- Linked article tags to their respective filter pages.
- Adjusted related content images to prevent distortion.
- Added a section in the "About Us" page for physician registration guidance.
- Updated the logo in the "About Us" header to the correct version.
- Added tests for the new functionality and ensured existing tests are updated accordingly.
2026-08-08 21:06:48 +03:30

47 lines
1.6 KiB
JavaScript

import { describe, expect, it } from "vitest";
import { render, screen } from "@testing-library/react";
import Head from "@/components/aboutUs/Head";
const CITY = { name: "یاسوج", site_name: "یاسوج نوبت", logo_url: null };
describe("سربرگ درباره ما", () => {
it("شهر بدون logo_url لوگوی درون‌خطی با رنگ روشن می‌گیرد", () => {
const { container } = render(
<Head siteName={CITY.site_name} slogan="کنار شما" city={CITY} />
);
const path = container.querySelector("svg path");
// پس‌زمینهٔ هدر #5559C2 است؛ رنگ پیش‌فرض لوگو روی آن دیده نمی‌شود.
expect(path).toHaveAttribute("stroke", "#FAFAFA");
});
it("شهر دارای logo_url همان تصویر را نشان می‌دهد", () => {
render(
<Head
siteName={CITY.site_name}
city={{ ...CITY, logo_url: "https://cdn.test/logo.png" }}
/>
);
expect(screen.getByRole("img", { name: "logo" })).toHaveAttribute(
"src",
"https://cdn.test/logo.png"
);
});
it("لوگوی قدیمی logo-2.png دیگر رندر نمی‌شود", () => {
const { container } = render(<Head siteName={CITY.site_name} city={CITY} />);
expect(container.innerHTML).not.toContain("logo-2");
});
it("شعار نداشتن، سربرگ را نمی‌شکند", () => {
render(<Head siteName={CITY.site_name} city={CITY} />);
expect(
screen.getByRole("heading", { name: `درباره ${CITY.site_name}` })
).toBeInTheDocument();
});
});