feat: enhance SEO for listing and specialty pages, fix search autocomplete issue
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import specialtiesData from "@/data/specialties.json";
|
||||
import { isCategorySpecialty, isIndexableSpecialty } from "@/lib/specialtyIndexing";
|
||||
|
||||
const bySlug = (slug) => specialtiesData.find((item) => item.slug === slug);
|
||||
|
||||
describe("isCategorySpecialty", () => {
|
||||
it("والدِ دارای زیرشاخهٔ فعال دسته است → noindex", () => {
|
||||
expect(isCategorySpecialty(bySlug("internal-medicine"))).toBe(true);
|
||||
});
|
||||
|
||||
it("زیرشاخه هرگز دسته نیست → index", () => {
|
||||
expect(isCategorySpecialty(bySlug("gastroenterology"))).toBe(false);
|
||||
expect(isIndexableSpecialty(bySlug("gastroenterology"))).toBe(true);
|
||||
});
|
||||
|
||||
it("والدِ بدون زیرشاخه در عمل برگ است → index", () => {
|
||||
expect(isCategorySpecialty(bySlug("general-practitioner"))).toBe(false);
|
||||
expect(isIndexableSpecialty(bySlug("general-practitioner"))).toBe(true);
|
||||
});
|
||||
|
||||
it("ورودی تهی امن است", () => {
|
||||
expect(isCategorySpecialty(null)).toBe(false);
|
||||
expect(isIndexableSpecialty(null)).toBe(false);
|
||||
expect(isIndexableSpecialty(undefined)).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user