| ... | ... | @@ -4071,7 +4071,7 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { |
| 4071 | 4071 | }), |
| 4072 | 4072 | ); |
| 4073 | 4073 | |
| 4074 | | it.effect("generates PR content against the remote base when the local base is stale", () => |
| 4074 | it.effect("generates PR content from branch changes when the remote base advances", () => |
| 4075 | 4075 | Effect.gen(function* () { |
| 4076 | 4076 | const repoDir = yield* makeTempDir("t3code-git-manager-"); |
| 4077 | 4077 | yield* initRepo(repoDir); |
| ... | ... | @@ -4103,7 +4103,15 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { |
| 4103 | 4103 | yield* runGit(repoDir, ["push", "-u", "origin", "feature/remote-base"]); |
| 4104 | 4104 | yield* runGit(repoDir, ["config", "branch.feature/remote-base.gh-merge-base", "main"]); |
| 4105 | 4105 | |
| 4106 | NodeFS.writeFileSync(NodePath.join(peerDir, "later-main.txt"), "unrelated\n"); |
| 4107 | yield* runGit(peerDir, ["add", "later-main.txt"]); |
| 4108 | yield* runGit(peerDir, ["commit", "-m", "Later main commit"]); |
| 4109 | yield* runGit(peerDir, ["push", "origin", "main"]); |
| 4110 | yield* runGit(repoDir, ["fetch", "origin"]); |
| 4111 | |
| 4106 | 4112 | let generatedCommitSummary = ""; |
| 4113 | let generatedDiffSummary = ""; |
| 4114 | let generatedDiffPatch = ""; |
| 4107 | 4115 | const { manager } = yield* makeManager({ |
| 4108 | 4116 | ghScenario: { |
| 4109 | 4117 | prListSequence: ["[]", "[]"], |
| ... | ... | @@ -4111,6 +4119,8 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { |
| 4111 | 4119 | textGeneration: { |
| 4112 | 4120 | generatePrContent: (input) => { |
| 4113 | 4121 | generatedCommitSummary = input.commitSummary; |
| 4122 | generatedDiffSummary = input.diffSummary; |
| 4123 | generatedDiffPatch = input.diffPatch; |
| 4114 | 4124 | return Effect.succeed({ title: "Feature PR", body: "Feature body" }); |
| 4115 | 4125 | }, |
| 4116 | 4126 | }, |
| ... | ... | @@ -4124,6 +4134,11 @@ it.layer(GitManagerTestLayer)("GitManager", (it) => { |
| 4124 | 4134 | expect(result.pr.status).toBe("created"); |
| 4125 | 4135 | expect(generatedCommitSummary).toContain("Feature commit"); |
| 4126 | 4136 | expect(generatedCommitSummary).not.toContain("Remote base commit"); |
| 4137 | expect(generatedCommitSummary).not.toContain("Later main commit"); |
| 4138 | expect(generatedDiffSummary).toContain("feature.txt"); |
| 4139 | expect(generatedDiffSummary).not.toContain("later-main.txt"); |
| 4140 | expect(generatedDiffPatch).toContain("feature.txt"); |
| 4141 | expect(generatedDiffPatch).not.toContain("later-main.txt"); |
| 4127 | 4142 | }), |
| 4128 | 4143 | ); |
| 4129 | 4144 | |