Skip to content

Commit

Permalink
Update testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
HelloCore committed Oct 9, 2020
1 parent 31db8a6 commit a2c554a
Showing 1 changed file with 36 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,24 @@ describe("API testing - BitBucket Cloud", () => {
display_name: "name",
},
},
{
content: {
raw: `FAIL! danger-id-1; ${dangerSignaturePostfix({} as DangerResults, "1234")}`,
},
user: {
display_name: "name",
uuid: "{1234-1234-1234-1234}",
},
},
{
content: {
raw: "not a danger comment",
},
user: {
display_name: "someone",
uuid: "{1234-1234-1234-1235}",
},
},
],
})
const comments = await api.getDangerInlineComments("1")
Expand All @@ -173,7 +191,7 @@ describe("API testing - BitBucket Cloud", () => {
expect(result).toEqual(["activity"])
})

it("getDangerComments", async () => {
it("getDangerMainComments", async () => {
const commitID = "e70f3d6468f61a4bef68c9e6eaba9166b096e23c"
jsonResult = () => ({
isLastPage: true,
Expand All @@ -187,6 +205,21 @@ describe("API testing - BitBucket Cloud", () => {
uuid: "{1234-1234-1234-1234}",
},
},
{
content: {
raw:
"\n[//]: # (danger-id-1;)\n[//]: # ( File: dangerfile.ts;\n Line: 5;)\n\n- :warning: Hello updates\n\n\n ",
},
id: 1234,
inline: {
from: 5,
path: "dangerfile.ts",
},
user: {
uuid: "{1234-1234-1234-1234}",
display_name: "name",
},
},
{
content: {
raw: "not a danger comment",
Expand All @@ -198,7 +231,8 @@ describe("API testing - BitBucket Cloud", () => {
},
],
})
const result = await api.getDangerComments("1")

const result = await api.getDangerMainComments("1")

expect(api.fetch).toHaveBeenCalledWith(
"https://api.bitbucket.org/2.0/repositories/foo/bar/pullrequests/1/comments?q=deleted=false",
Expand Down

0 comments on commit a2c554a

Please sign in to comment.