27 lines
782 B
TypeScript
27 lines
782 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { indexInvalidationRegistry } from "../../src/contracts/query-invalidation.ts";
|
|
|
|
describe("query invalidation registry", () => {
|
|
it.each([
|
|
{
|
|
label: "topic",
|
|
registry: {
|
|
topics: ["orders\u0000private"],
|
|
namespaces: ["orders"],
|
|
edges: [{ topicId: "orders\u0000private", namespace: "orders" }],
|
|
},
|
|
},
|
|
{
|
|
label: "namespace",
|
|
registry: {
|
|
topics: ["orders"],
|
|
namespaces: ["orders\u001fprivate"],
|
|
edges: [{ topicId: "orders", namespace: "orders\u001fprivate" }],
|
|
},
|
|
},
|
|
])("rejects control characters in a registry $label", ({ registry }) => {
|
|
expect(() => indexInvalidationRegistry(registry)).toThrow(/is invalid/u);
|
|
});
|
|
});
|