mirror of
https://github.com/zhigang1992/probot.git
synced 2026-06-19 18:14:06 +08:00
Remove reactions, which are not supported by integrations
This commit is contained in:
@@ -145,12 +145,6 @@ Add labels
|
||||
.unassign('defunkt');
|
||||
```
|
||||
|
||||
#### `react`
|
||||
|
||||
```
|
||||
.react('heart'); # or +1, -1, laugh, confused, heart, hooray
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
See [examples](examples.md) for ideas of behaviors you can implement by combining these configuration options.
|
||||
|
||||
@@ -47,11 +47,6 @@ const IssuePlugin = superclass => class extends superclass {
|
||||
return this;
|
||||
}
|
||||
|
||||
react(reaction) {
|
||||
this._setCommentData({reaction});
|
||||
return this;
|
||||
}
|
||||
|
||||
_setCommentData(obj) {
|
||||
if (this.issueActions === undefined) {
|
||||
this.issueActions = {};
|
||||
@@ -143,13 +138,6 @@ class IssueEvaluator extends Evaluator {
|
||||
);
|
||||
}
|
||||
|
||||
if (workflow.issueActions.reaction !== undefined) {
|
||||
const reaction = workflow.issueActions.reaction;
|
||||
promises.push(
|
||||
context.github.reactions.createForIssue(context.payload.toIssue({content: reaction}))
|
||||
);
|
||||
}
|
||||
|
||||
return promises;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,7 @@ const createSpy = expect.createSpy;
|
||||
config.content = new Buffer(`
|
||||
on("issues.opened")
|
||||
.comment("Hello World!")
|
||||
.assign("bkeepers")
|
||||
.react("heart");
|
||||
.assign("bkeepers");
|
||||
|
||||
on("issues.closed")
|
||||
.unassign("bkeepers");
|
||||
|
||||
@@ -7,9 +7,6 @@ const payload = require('../fixtures/webhook/comment.created.json');
|
||||
const createSpy = expect.createSpy;
|
||||
|
||||
const github = {
|
||||
reactions: {
|
||||
createForIssue: createSpy()
|
||||
},
|
||||
issues: {
|
||||
lock: createSpy(),
|
||||
unlock: createSpy(),
|
||||
@@ -210,18 +207,4 @@ describe('issues plugin', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('reactions', () => {
|
||||
it('react', () => {
|
||||
this.w.react('heart');
|
||||
|
||||
Promise.all(this.evaluator.evaluate(this.w, context));
|
||||
expect(github.reactions.createForIssue).toHaveBeenCalledWith({
|
||||
owner: 'bkeepers-inc',
|
||||
repo: 'test',
|
||||
number: 6,
|
||||
content: 'heart'
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user