Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(pull-requests): pull request detail opens when the token cannot read checks #16171

ClosedScottN-PV(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/16171/headopened View on GitHub

Showing 17 changed files with 58 additions and 0 deletions (loading 14).

x
0 of 17 viewed, 17 left
49 additions and 0 deletionsapps/server/src/pullRequest/PullRequestService.test.tsModified
View file
@@ -395,6 +395,55 @@
}),
​
+it.effect("passes on the head's check state only with checks the host would not show", () =>
+ Effect.gen(function* () {
+ const service = yield* makeService({
+ projects: [project({ id: "p1", title: "web", workspaceRoot: "/w", repository: "acme/web" })],
+ providers: [
+ fakeProvider("github", {
+ getChangeRequest: () =>
+ Effect.succeed({
+ ...hostedChangeRequest("Description"),
+ checksState: "passing" as const,
+ checksUnreadable: true,
+ }),
+ }),
+ ],
+ });
+ const detail = yield* service.detail({
+ projectId: "p1" as ProjectId,
+ repository: "acme/web",
+ number: 1,
+ });
+ assert.strictEqual(detail.checksUnreadable, true);
+ assert.strictEqual(detail.checksRollupState, "passing");
+ }),
+);
+​
+it.effect("sends no separate check state with checks the host showed", () =>