All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 50s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 lines
729 B
TypeScript
18 lines
729 B
TypeScript
import "../setup.ts";
|
|
import { assert, assertFalse } from "@std/assert";
|
|
import {
|
|
isCreateCommentRequest,
|
|
isUpdateCommentRequest,
|
|
} from "../../validators/comment.ts";
|
|
|
|
Deno.test("comment requests: non-blank, bounded, optional parent", () => {
|
|
assert(isCreateCommentRequest({ body: "hi" }));
|
|
assert(isCreateCommentRequest({ body: "hi", parentId: null }));
|
|
assert(isCreateCommentRequest({ body: "hi", parentId: "p" }));
|
|
assertFalse(isCreateCommentRequest({ body: " " }));
|
|
assertFalse(isCreateCommentRequest({ body: "x".repeat(5001) }));
|
|
assertFalse(isCreateCommentRequest({ body: "hi", parentId: 3 }));
|
|
assert(isUpdateCommentRequest({ body: "edit" }));
|
|
assertFalse(isUpdateCommentRequest({ body: "" }));
|
|
});
|