Skip to content

Commit

Permalink
chore(test): fixed test since response modified with triggerEvents
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinRousselet committed Aug 8, 2024
1 parent 18c3366 commit d32d682
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/api/funnel/executePluginRequest.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,26 +104,24 @@ describe("funnel.executePluginRequest", () => {

it("should trigger pipes if triggerEvent is enabled", async () => {
const request = new Request({
controller: "testme",
action: "succeed",
controller: "testme",
triggerEvents: true,
});

return funnel.executePluginRequest(request).then((response) => {
should(response).be.exactly(request);
return funnel.executePluginRequest(request).then(() => {
should(kuzzle.pipe).calledWith("testme:beforeSucceed");
should(kuzzle.pipe).calledWith("testme:afterSucceed");
});
});

it("should not trigger pipes if triggerEvent is disabled", async () => {
const request = new Request({
controller: "testme",
action: "succeed",
controller: "testme",
});

return funnel.executePluginRequest(request).then((response) => {
should(response).be.exactly(request);
return funnel.executePluginRequest(request).then(() => {
should(kuzzle.pipe).not.calledWith("testme:beforeSucceed");
should(kuzzle.pipe).not.calledWith("testme:afterSucceed");
});
Expand Down

0 comments on commit d32d682

Please sign in to comment.