test(api): lock comment entity registry metadata
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
import {
|
||||||
|
CommentEntityTypeSchema,
|
||||||
|
getCommentToolEntityDescription,
|
||||||
|
getCommentToolScopeSentence,
|
||||||
|
getSupportedCommentEntityTypes,
|
||||||
|
} from "../lib/comment-entity-registry.js";
|
||||||
|
|
||||||
|
describe("comment entity registry metadata", () => {
|
||||||
|
it("keeps the router schema and helper metadata aligned", () => {
|
||||||
|
expect(getSupportedCommentEntityTypes()).toEqual(["estimate", "resource"]);
|
||||||
|
expect(CommentEntityTypeSchema.options).toEqual(["estimate", "resource"]);
|
||||||
|
expect(getCommentToolEntityDescription()).toContain("estimate, resource");
|
||||||
|
expect(getCommentToolScopeSentence()).toContain("Supported comment entities: estimate, resource.");
|
||||||
|
expect(getCommentToolScopeSentence()).toContain("resource comments follow resource detail visibility");
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
export const COMMENT_ENTITY_TYPE_VALUES = ["estimate", "resource"] as const;
|
||||||
|
|
||||||
|
export type CommentEntityType = (typeof COMMENT_ENTITY_TYPE_VALUES)[number];
|
||||||
|
|
||||||
|
export const COMMENT_ENTITY_LABELS: Record<CommentEntityType, string> = {
|
||||||
|
estimate: "estimate",
|
||||||
|
resource: "resource",
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user