feat(issues): add issue documents and inline editing
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
29
server/src/__tests__/documents.test.ts
Normal file
29
server/src/__tests__/documents.test.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { extractLegacyPlanBody } from "../services/documents.js";
|
||||
|
||||
describe("extractLegacyPlanBody", () => {
|
||||
it("returns null when no plan block exists", () => {
|
||||
expect(extractLegacyPlanBody("hello world")).toBeNull();
|
||||
});
|
||||
|
||||
it("extracts plan body from legacy issue descriptions", () => {
|
||||
expect(
|
||||
extractLegacyPlanBody(`
|
||||
intro
|
||||
|
||||
<plan>
|
||||
|
||||
# Plan
|
||||
|
||||
- one
|
||||
- two
|
||||
|
||||
</plan>
|
||||
`),
|
||||
).toBe("# Plan\n\n- one\n- two");
|
||||
});
|
||||
|
||||
it("ignores empty plan blocks", () => {
|
||||
expect(extractLegacyPlanBody("<plan> </plan>")).toBeNull();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user