mirror of
https://github.com/better-auth/better-auth.git
synced 2026-10-18 11:32:15 -05:00
29 lines
643 B
TypeScript
29 lines
643 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { isPathWithinFolderIndex } from "./page-tree";
|
|
|
|
describe("isPathWithinFolderIndex", () => {
|
|
it("matches a folder index and its hidden descendants", () => {
|
|
expect(
|
|
isPathWithinFolderIndex(
|
|
"/docs/reference/errors",
|
|
"/docs/reference/errors",
|
|
),
|
|
).toBe(true);
|
|
expect(
|
|
isPathWithinFolderIndex(
|
|
"/docs/reference/errors",
|
|
"/docs/reference/errors/unknown",
|
|
),
|
|
).toBe(true);
|
|
});
|
|
|
|
it("does not match sibling paths", () => {
|
|
expect(
|
|
isPathWithinFolderIndex(
|
|
"/docs/reference/errors",
|
|
"/docs/reference/resources",
|
|
),
|
|
).toBe(false);
|
|
});
|
|
});
|