25 lines
748 B
TypeScript
25 lines
748 B
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { assembleRegistry } from "../src/registry/registry";
|
|
|
|
describe("assembleRegistry", () => {
|
|
it("creates a registry with pages", () => {
|
|
const result = assembleRegistry("https://example.com", "Example", [
|
|
{
|
|
url: "https://example.com/",
|
|
path: "/",
|
|
title: "Home",
|
|
description: null,
|
|
statusCode: 200,
|
|
contentType: "text/html",
|
|
links: [],
|
|
},
|
|
]);
|
|
|
|
expect(result.registry.url).toBe("https://example.com");
|
|
expect(result.registry.name).toBe("Example");
|
|
expect(result.pages).toHaveLength(1);
|
|
expect(result.pages[0].id).toBeDefined();
|
|
expect(result.pages[0].registryId).toBe(result.registry.id);
|
|
});
|
|
});
|