Skip to content

Commit 34ebd6e

Browse files
fix: update tests to reflect changed success method (see #857)
1 parent 6b00c9f commit 34ebd6e

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

test/success.test.js

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2175,14 +2175,17 @@ test('Add comment on issues/PR and skip label if "successComment" is unset / "re
21752175
.getOnce(`https://api.github.local/repos/${owner}/${repo}`, {
21762176
full_name: `${owner}/${repo}`,
21772177
})
2178-
.getOnce(
2179-
`https://api.github.local/search/issues?q=${encodeURIComponent(
2180-
`repo:${owner}/${repo}`,
2181-
)}+${encodeURIComponent("type:pr")}+${encodeURIComponent(
2182-
"is:merged",
2183-
)}+${commits.map((commit) => commit.hash).join("+")}`,
2184-
{ items: prs },
2185-
)
2178+
.postOnce("https://api.github.local/graphql", {
2179+
data: {
2180+
repository: {
2181+
commit123: {
2182+
associatedPullRequests: {
2183+
nodes: [prs[0]],
2184+
},
2185+
},
2186+
},
2187+
},
2188+
})
21862189
.getOnce(
21872190
`https://api.github.local/repos/${owner}/${repo}/pulls/1/commits`,
21882191
[{ sha: commits[0].hash }],
@@ -2261,14 +2264,17 @@ test('Skip comment on issues/PR and add label if "successComment" is "false" / "
22612264
.getOnce(`https://api.github.local/repos/${owner}/${repo}`, {
22622265
full_name: `${owner}/${repo}`,
22632266
})
2264-
.getOnce(
2265-
`https://api.github.local/search/issues?q=${encodeURIComponent(
2266-
`repo:${owner}/${repo}`,
2267-
)}+${encodeURIComponent("type:pr")}+${encodeURIComponent(
2268-
"is:merged",
2269-
)}+${commits.map((commit) => commit.hash).join("+")}`,
2270-
{ items: prs },
2271-
)
2267+
.postOnce("https://api.github.local/graphql", {
2268+
data: {
2269+
repository: {
2270+
commit123: {
2271+
associatedPullRequests: {
2272+
nodes: [prs[0]],
2273+
},
2274+
},
2275+
},
2276+
},
2277+
})
22722278
.getOnce(
22732279
`https://api.github.local/repos/${owner}/${repo}/pulls/1/commits`,
22742280
[{ sha: commits[0].hash }],

0 commit comments

Comments
 (0)