Skip to content

Commit

Permalink
Fix part of #174: Add test to ensure that bot doesn't gets triggred w…
Browse files Browse the repository at this point in the history
…ith "@{{username}} PTAL" comment (#191)

* added-test

* updated

* updated

* test-updated

* updated

* updated

* nits
  • Loading branch information
mridul-netizen authored May 18, 2021
1 parent 2053701 commit 2d02f32
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/checkPullRequestReviewSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1587,5 +1587,24 @@ describe('Pull Request Review Module', () => {
});
}
);

describe('when PTAL template found in the comment', () => {
const initialCommentBody = commentPayloadData.payload.comment.body;
beforeAll(() => {
commentPayloadData.payload.comment.body = (
'{{Question/comment}} @{{reviewer_username}} PTAL');
});
beforeEach(async () => {
await robot.receive(commentPayloadData);
});

it('should not assign anyone to the PR', () => {
expect(github.issues.createComment).not.toHaveBeenCalled();
});

afterAll(() => {
commentPayloadData.payload.comment.body = initialCommentBody;
});
});
});
});

0 comments on commit 2d02f32

Please sign in to comment.