Skip to content

Commit ed00a8d

Browse files
committed
Fix broken tests
1 parent 111d24f commit ed00a8d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/loading/internal/pull-requests.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ describe("refreshOpenPullRequests", () => {
8888
mocked(githubApi.loadComments).mockReturnValue(Promise.resolve([]));
8989
mocked(githubApi.loadReviews).mockReturnValue(Promise.resolve([]));
9090
mocked(githubApi.loadCommits).mockReturnValue(Promise.resolve([]));
91+
mocked(githubApi.loadPullRequestStatus).mockReturnValue(
92+
Promise.resolve({
93+
reviewDecision: "REVIEW_REQUIRED",
94+
})
95+
);
9196
const result = await refreshOpenPullRequests(githubApi, "fwouts");
9297
expect(result).toHaveLength(3);
9398
expect(mocked(githubApi.searchPullRequests).mock.calls).toEqual([
@@ -108,5 +113,6 @@ function mockGitHubApi(): GitHubApi {
108113
loadReviews: jest.fn(),
109114
loadComments: jest.fn(),
110115
loadCommits: jest.fn(),
116+
loadPullRequestStatus: jest.fn(),
111117
};
112118
}

src/testing/fake-pr.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ class FakePullRequestBuilder {
130130
comments: this._comments,
131131
reviews: this._reviews,
132132
commits: this._commits,
133+
reviewDecision: "REVIEW_REQUIRED",
133134
};
134135
}
135136

0 commit comments

Comments
 (0)