Skip to content

Commit

Permalink
fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
codestergit committed Apr 17, 2018
1 parent 150eab0 commit 0dc3076
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ exports[`the dangerfile gitDSL - BitBucket Server should include \`after\` text

exports[`the dangerfile gitDSL - BitBucket Server should include \`before\` text content of the file 1`] = `"{\\"path\\":\\".gitignore\\",\\"repoSlug\\":\\"projects/PROJ/repos/repo\\",\\"ref\\":\\"d6725486c38d46a33e76f622cf24b9a388c8d13d\\"}"`;

exports[`the dangerfile gitDSL - BitBucket Server should include \`removed\` text content of the file 1`] = `"node_modules*.log/test.py/.vscode.DS_Storecoverage.idea__pycache__/*.pyc*.swp"`;
exports[`the dangerfile gitDSL - BitBucket Server should include \`removed\` text content of the file 1`] = `""`;

exports[`the dangerfile gitDSL - BitBucket Server shows the diff for a specific file 1`] = `"node_modules*.log/test.py/.vscode.DS_Storecoverage.idea__pycache__/*.pyc*.swp"`;
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe("API testing - BitBucket Server", () => {
expect(api.fetch).toHaveBeenCalledWith(
`${host}/rest/api/1.0/projects/FOO/repos/BAR/pull-requests` +
`?at=refs/heads/branch&withProperties=false&withAttributes=false`,
{ method: "GET", body: {}, headers: expectedJSONHeaders },
{ method: "GET", body: null, headers: expectedJSONHeaders },
undefined
)
expect(result).toEqual(jsonResult.values)
Expand All @@ -47,7 +47,7 @@ describe("API testing - BitBucket Server", () => {

expect(api.fetch).toHaveBeenCalledWith(
`${host}/rest/api/1.0/projects/FOO/repos/BAR/pull-requests/1`,
{ method: "GET", body: {}, headers: expectedJSONHeaders },
{ method: "GET", body: null, headers: expectedJSONHeaders },
undefined
)
expect(result).toEqual(jsonResult)
Expand All @@ -59,7 +59,7 @@ describe("API testing - BitBucket Server", () => {

expect(api.fetch).toHaveBeenCalledWith(
`${host}/rest/api/1.0/projects/FOO/repos/BAR/pull-requests/1/commits`,
{ method: "GET", body: {}, headers: expectedJSONHeaders },
{ method: "GET", body: null, headers: expectedJSONHeaders },
undefined
)
expect(result).toEqual(jsonResult.values)
Expand All @@ -73,7 +73,7 @@ describe("API testing - BitBucket Server", () => {
`${host}/rest/api/1.0/projects/FOO/repos/BAR/compare/diff` +
//
`?withComments=false&from=BASE&to=HEAD`,
{ method: "GET", body: {}, headers: expectedJSONHeaders },
{ method: "GET", body: null, headers: expectedJSONHeaders },
undefined
)
expect(result).toEqual(jsonResult.diffs)
Expand All @@ -87,7 +87,7 @@ describe("API testing - BitBucket Server", () => {
`${host}/rest/api/1.0/projects/FOO/repos/BAR/pull-requests/1/diff` +
//
`?withComments=false`,
{ method: "GET", body: {}, headers: expectedJSONHeaders },
{ method: "GET", body: null, headers: expectedJSONHeaders },
undefined
)
expect(result).toEqual(jsonResult.diffs)
Expand All @@ -101,7 +101,7 @@ describe("API testing - BitBucket Server", () => {
`${host}/rest/api/1.0/projects/FOO/repos/BAR/pull-requests/1/activities` +
//
`?fromType=COMMENT`,
{ method: "GET", body: {}, headers: expectedJSONHeaders },
{ method: "GET", body: null, headers: expectedJSONHeaders },
undefined
)
expect(result).toEqual(jsonResult.values)
Expand All @@ -115,7 +115,7 @@ describe("API testing - BitBucket Server", () => {
`${host}/rest/api/1.0/projects/FOO/repos/BAR/pull-requests/1/activities` +
//
`?fromType=ACTIVITY`,
{ method: "GET", body: {}, headers: expectedJSONHeaders },
{ method: "GET", body: null, headers: expectedJSONHeaders },
undefined
)
expect(result).toEqual(jsonResult.values)
Expand All @@ -127,7 +127,7 @@ describe("API testing - BitBucket Server", () => {

expect(api.fetch).toHaveBeenCalledWith(
`${host}/rest/jira/1.0/projects/FOO/repos/BAR/pull-requests/1/issues`,
{ method: "GET", body: {}, headers: expectedJSONHeaders },
{ method: "GET", body: null, headers: expectedJSONHeaders },
undefined
)
expect(result).toEqual(jsonResult)
Expand Down Expand Up @@ -161,7 +161,7 @@ describe("API testing - BitBucket Server", () => {

expect(api.fetch).toHaveBeenCalledWith(
`${host}/rest/api/1.0/projects/FOO/repos/BAR/pull-requests/1/activities?fromType=COMMENT`,
{ method: "GET", body: {}, headers: expectedJSONHeaders },
{ method: "GET", body: null, headers: expectedJSONHeaders },
undefined
)
expect(result).toEqual([jsonResult.values[0].comment])
Expand All @@ -173,7 +173,7 @@ describe("API testing - BitBucket Server", () => {

expect(api.fetch).toHaveBeenCalledWith(
`${host}/projects/FOO/repos/BAR/raw/path/to/foo.txt?at=master`,
{ method: "GET", body: {}, headers: expectedJSONHeaders },
{ method: "GET", body: null, headers: expectedJSONHeaders },
true
)
expect(result).toEqual(textResult)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,28 @@ describe("generating messages for BitBucket server", () => {

describe("generating inline messages", () => {
it("Shows the failing message", () => {
const issues = inlineTemplate(failsResults)
const issues = inlineTemplate("blankID", failsResults, "File.swift", 5)
expect(issues).toContain("- :no_entry_sign: Failing message")
expect(issues).not.toContain("- :warning:")
expect(issues).not.toContain("- :book:")
})

it("Shows the warning message", () => {
const issues = inlineTemplate(warnResults)
const issues = inlineTemplate("blankID", warnResults, "File.swift", 5)
expect(issues).toContain("- :warning: Warning message")
expect(issues).not.toContain("- :no_entry_sign:")
expect(issues).not.toContain("- :book:")
})

it("Shows the message", () => {
const issues = inlineTemplate(messagesResults)
const issues = inlineTemplate("blankID", messagesResults, "File.swift", 5)
expect(issues).toContain("- :book: Message")
expect(issues).not.toContain("- :no_entry_sign:")
expect(issues).not.toContain("- :warning:")
})

it("Shows markdowns one after another", () => {
const issues = inlineTemplate(markdownResults)
const issues = inlineTemplate("blankID", markdownResults, "File.swift", 5)
const expected = `
### Short Markdown Message1
Expand Down

0 comments on commit 0dc3076

Please sign in to comment.