feat: Refactor clinic-related functions and tests, removing doctor intro logic
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { buildSpecialtyFaq, buildSpecialtyIntro } from "@/lib/specialtyContent";
|
||||
import { buildClinicsIntro, buildDoctorsIntro } from "@/lib/listingIntro";
|
||||
import { buildClinicsIntro } from "@/lib/listingIntro";
|
||||
|
||||
const words = (text) => text.trim().split(/\s+/).length;
|
||||
|
||||
@@ -28,18 +28,19 @@ describe("متن مقدمهٔ تخصص (M2)", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("متن مقدمهٔ صفحات لیست (M2)", () => {
|
||||
it("بین ۱۵۰ تا ۳۰۰ کلمه", () => {
|
||||
// متن /doctors حذف شد — آن صفحه فقط کارت پزشکها را نشان میدهد، پس
|
||||
// buildDoctorsIntro و مخزن متنش هم برداشته شدند. اینجا فقط /clinics میماند.
|
||||
describe("متن مقدمهٔ صفحهٔ کلینیکها (M2)", () => {
|
||||
it("بین ۱۰۰ تا ۳۰۰ کلمه", () => {
|
||||
for (const city of CITIES) {
|
||||
for (const text of [buildDoctorsIntro(city), buildClinicsIntro(city)]) {
|
||||
expect(words(text), `${city} = ${words(text)}`).toBeGreaterThanOrEqual(100);
|
||||
expect(words(text), `${city} = ${words(text)}`).toBeLessThanOrEqual(300);
|
||||
}
|
||||
const text = buildClinicsIntro(city);
|
||||
expect(words(text), `${city} = ${words(text)}`).toBeGreaterThanOrEqual(100);
|
||||
expect(words(text), `${city} = ${words(text)}`).toBeLessThanOrEqual(300);
|
||||
}
|
||||
});
|
||||
|
||||
it("ساختار متن بین شهرها متفاوت است", () => {
|
||||
const texts = CITIES.map(buildDoctorsIntro);
|
||||
const texts = CITIES.map((city) => buildClinicsIntro(city));
|
||||
expect(new Set(texts).size).toBe(CITIES.length);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user