feat: Enhance metadata generation for About Us and Contact Us pages, implement legacy slug resolution for blog posts, and add city-specific intros

This commit is contained in:
hamed
2026-08-09 07:14:15 +03:30
parent 9cfbd2e002
commit 002f388ac8
12 changed files with 334 additions and 28 deletions
+34
View File
@@ -0,0 +1,34 @@
import { describe, expect, it } from "vitest";
import { isNoindexDoctor, isThinDoctor } from "@/lib/entityQuality";
const DOCTOR = {
uuid: "1a55deaa-6c43-440d-b126-5870521ebc26",
name: "دکتر رضایی",
specialties: [{ name: "قلب و عروق" }],
address: [{ address: "یاسوج، خیابان اصلی" }],
};
describe("ایندکس‌پذیری پزشک", () => {
it("پروفایل claim نشدهٔ دارای محتوا ایندکس می‌شود", () => {
// پیش از این، همین حالت ۸۰ صفحهٔ یاسوج را noindex می‌کرد.
expect(isNoindexDoctor({ ...DOCTOR, owner_status: "unclaimed" })).toBe(false);
expect(isNoindexDoctor({ ...DOCTOR, owner_status: undefined })).toBe(false);
});
it("پروفایل claim شده هم ایندکس می‌شود", () => {
expect(isNoindexDoctor({ ...DOCTOR, owner_status: "claimed" })).toBe(false);
});
it("پروفایل بی‌محتوا همچنان noindex می‌ماند", () => {
expect(
isNoindexDoctor({ uuid: DOCTOR.uuid, name: "دکتر رضایی" })
).toBe(true);
expect(isNoindexDoctor({ ...DOCTOR, name: "09121234567" })).toBe(true);
expect(isNoindexDoctor({ ...DOCTOR, uuid: undefined })).toBe(true);
});
it("تخصص یا نشانی، هرکدام به‌تنهایی کافی است", () => {
expect(isThinDoctor({ ...DOCTOR, address: [] })).toBe(false);
expect(isThinDoctor({ ...DOCTOR, specialties: [] })).toBe(false);
});
});