Skip to content

Commit

Permalink
fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
rgdoliveira committed Oct 4, 2023
1 parent d060b00 commit 2932ab6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
17 changes: 13 additions & 4 deletions test/e2e/cross-pr/cross-pr.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,22 @@ test("PR from owner1/target:branchA to owner2/target:branchB while using mapping
mockApi: [
moctokit.rest.repos
.get({
owner: "owner1",
repo: /project(1|2|4)/,
owner: "owner2",
repo: /project(1|2)/,
})
.setResponse({
status: 404,
data: {},
repeat: 3
repeat: 2
}),
moctokit.rest.repos
.get({
owner: "owner2",
repo: "project4"
})
.setResponse({
status: 200,
data: {},
}),
moctokit.rest.repos
.listForks({
Expand All @@ -184,7 +193,7 @@ test("PR from owner1/target:branchA to owner2/target:branchB while using mapping
}),
moctokit.rest.repos
.get({
owner: "owner1",
owner: "owner2",
repo: "project3",
})
.setResponse({
Expand Down
17 changes: 13 additions & 4 deletions test/e2e/full-downstream/full-downstream.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,22 @@ test("PR from owner1/target:branchA to owner2/target:branchB while using mapping
mockApi: [
moctokit.rest.repos
.get({
owner: "owner1",
repo: /project(1|2|3|4)/,
owner: "owner2",
repo: "project2",
})
.setResponse({
status: 404,
data: {},
repeat: 4
}),
moctokit.rest.repos
.get({
owner: "owner2",
repo: /project(1|3|4)/,
})
.setResponse({
status: 200,
data: {},
repeat: 3
}),
moctokit.rest.repos
.listForks({
Expand Down Expand Up @@ -313,7 +322,7 @@ test("PR from owner1/target:branchA to owner2/target:branchB while using mapping
);
expect(group4.output).toEqual(
expect.stringContaining(
"Merged owner1/project4:branchA into branch 8.x"
"Merged owner2/project4:branchA into branch 8.x"
)
);

Expand Down
6 changes: 3 additions & 3 deletions test/e2e/single-pr/single-pr.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,15 @@ test("PR from owner2/target:branchA to owner1/target:branchB", async () => {
mockApi: [
moctokit.rest.repos
.get({
owner: "owner1",
owner: "owner2",
repo: "project3",
})
.setResponse({
status: 200,
data: {
name: "project3",
owner: {
login: "owner1",
login: "owner2",
},
},
}),
Expand Down Expand Up @@ -391,7 +391,7 @@ test("PR from owner2/target:branchA to owner1/target-different-name:branchB", as
mockApi: [
moctokit.rest.repos
.get({
owner: "owner1",
owner: "owner2",
repo: "project1",
})
.setResponse({
Expand Down

0 comments on commit 2932ab6

Please sign in to comment.