Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

proposedPlan.test.ts

27 lines907 Bytes

1import { describe, expect, it } from "vite-plus/test";
2​
3import { resolvePlanFollowUpSubmission } from "./proposedPlan";
4​
5describe("resolvePlanFollowUpSubmission", () => {
6 it.each(["", "Consider this "])(
7 "keeps context-bearing feedback in plan mode with prose %j",
8 (prose) => {
9 const draftText = `${prose}[PR #42](t3-context://v1/review-comment/pr-42)`;
10 expect(resolvePlanFollowUpSubmission({ draftText, planMarkdown: "# Plan" })).toEqual({
11 text: draftText,
12 interactionMode: "plan",
13 });
14 },
15 );
16 it("switches to default mode when implementing the ready plan without extra text", () => {
17 expect(
18 resolvePlanFollowUpSubmission({
19 draftText: " ",
20 planMarkdown: "## Ship it\n\n- step 1\n",
21 }),
22 ).toEqual({
23 text: "PLEASE IMPLEMENT THIS PLAN:\n## Ship it\n\n- step 1",
24 interactionMode: "default",
25 });
26 });
27});