feat: Refactor clinic-related functions and tests, removing doctor intro logic
This commit is contained in:
@@ -3,7 +3,6 @@ import cityData from "@/data/city.json";
|
||||
import {
|
||||
buildCityIntro,
|
||||
buildClinicsIntro,
|
||||
buildDoctorsIntro,
|
||||
} from "@/lib/listingIntro";
|
||||
|
||||
const CITIES = ["بهبهان", "یاسوج", "یزد", "تبریز", "اصفهان"];
|
||||
@@ -81,22 +80,21 @@ describe("جملهٔ آماری متن صفحات لیست", () => {
|
||||
});
|
||||
|
||||
it("آمار صفر جمله را اضافه نمیکند", () => {
|
||||
const withZero = buildDoctorsIntro("بهبهان", 0);
|
||||
const without = buildDoctorsIntro("بهبهان");
|
||||
const withZero = buildClinicsIntro("بهبهان", 0);
|
||||
const without = buildClinicsIntro("بهبهان");
|
||||
|
||||
expect(withZero).toBe(without);
|
||||
expect(withZero).not.toContain("0 پزشک");
|
||||
expect(withZero).not.toContain("0 مرکز درمانی");
|
||||
});
|
||||
|
||||
it("ورودی نامعتبر جمله را اضافه نمیکند", () => {
|
||||
const text = buildDoctorsIntro("بهبهان", "abc");
|
||||
const text = buildClinicsIntro("بهبهان", "abc");
|
||||
|
||||
expect(text).not.toContain("NaN");
|
||||
expect(text).toBe(buildDoctorsIntro("بهبهان"));
|
||||
expect(text).toBe(buildClinicsIntro("بهبهان"));
|
||||
});
|
||||
|
||||
it("نام شهر و واحد درست در جمله میآید", () => {
|
||||
expect(buildDoctorsIntro("یزد", 40)).toContain("40 پزشک در یزد");
|
||||
expect(buildClinicsIntro("یزد", 9)).toContain("9 مرکز درمانی در یزد");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user