16 lines
641 B
TypeScript
16 lines
641 B
TypeScript
// @vitest-environment node
|
|
import { readFileSync } from "node:fs";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import { describe, expect, test } from "vitest";
|
|
|
|
const source = readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), "DropdownDots.tsx"), "utf8");
|
|
|
|
describe("DropdownDots disabled links", () => {
|
|
test("disabled href items do not render navigable links", () => {
|
|
expect(source).toContain("item.href && !item.disabled");
|
|
expect(source).not.toContain('to={item.disabled ? "" : item.href}');
|
|
expect(source).toContain("aria-disabled={item.disabled || undefined}");
|
|
});
|
|
});
|