mirror of
https://github.com/marocchino/sticky-pull-request-comment.git
synced 2026-04-06 06:29:25 +00:00
test: assert getBody is not called when validateExclusiveModes fails
Co-authored-by: marocchino <128431+marocchino@users.noreply.github.com>
This commit is contained in:
parent
2cdb9b3380
commit
5f745d4fa4
1 changed files with 6 additions and 0 deletions
|
|
@ -117,6 +117,7 @@ describe("run", () => {
|
|||
expect(core.setFailed).toHaveBeenCalledWith(
|
||||
"delete and recreate cannot be set to true simultaneously",
|
||||
)
|
||||
expect(mockConfig.getBody).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
test("fails when deleteOldComment and onlyCreateComment are both true", async () => {
|
||||
|
|
@ -126,6 +127,7 @@ describe("run", () => {
|
|||
expect(core.setFailed).toHaveBeenCalledWith(
|
||||
"delete and only_create cannot be set to true simultaneously",
|
||||
)
|
||||
expect(mockConfig.getBody).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
test("fails when deleteOldComment and hideOldComment are both true", async () => {
|
||||
|
|
@ -135,6 +137,7 @@ describe("run", () => {
|
|||
expect(core.setFailed).toHaveBeenCalledWith(
|
||||
"delete and hide cannot be set to true simultaneously",
|
||||
)
|
||||
expect(mockConfig.getBody).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
test("fails when onlyCreateComment and onlyUpdateComment are both true", async () => {
|
||||
|
|
@ -144,6 +147,7 @@ describe("run", () => {
|
|||
expect(core.setFailed).toHaveBeenCalledWith(
|
||||
"only_create and only_update cannot be set to true simultaneously",
|
||||
)
|
||||
expect(mockConfig.getBody).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
test("fails when hideOldComment and hideAndRecreate are both true", async () => {
|
||||
|
|
@ -153,6 +157,7 @@ describe("run", () => {
|
|||
expect(core.setFailed).toHaveBeenCalledWith(
|
||||
"hide and hide_and_recreate cannot be set to true simultaneously",
|
||||
)
|
||||
expect(mockConfig.getBody).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
test("fails when deleteOldComment and hideAndRecreate are both true", async () => {
|
||||
|
|
@ -162,6 +167,7 @@ describe("run", () => {
|
|||
expect(core.setFailed).toHaveBeenCalledWith(
|
||||
"delete and hide_and_recreate cannot be set to true simultaneously",
|
||||
)
|
||||
expect(mockConfig.getBody).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
test("deletes previous comment when deleteOldComment is true and previous comment exists", async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue