Skip to content

Commit

Permalink
Added another parameterised invocation test
Browse files Browse the repository at this point in the history
  • Loading branch information
tompahoward committed Dec 22, 2020
1 parent f74457d commit b4ffcf6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/test/invoke-operation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,12 @@ Feature: Invoke Operation
And we invoke the "pong" operation with the input
| ping | pong |
Then resource returned will contain those values

Scenario: Invoke operation - parameterised with extra params
Given a resource with a "pong" operation that returns the provided "ping" parameter
When waychaser successfully loads that resource
And we invoke the "pong" operation with the input
| ping | pong |
| other | notUsed |
Then resource returned will contain only
| ping | pong |
7 changes: 5 additions & 2 deletions src/test/operations.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,14 @@ Then('the last resource returned will be the last item in the list', async funct
When('we invoke the {string} operation with the input', async function (relationship, dataTable) {
// we store it in expectedBody, because we use in in the next step
this.expectedBody = dataTable.rowsHash()
logger.debug('DATA TABLE', this.expectedBody)
await this.invoke(relationship, this.result, this.expectedBody)
})

Then('resource returned will contain those values', async function () {
logger.debug('DYNAMIC RESPONSE', this.result)
await this.checkBody(this.expectedBody)
})

Then('resource returned will contain only', async function (dataTable) {
const expectedBody = dataTable.rowsHash()
await this.checkBody(expectedBody)
})

0 comments on commit b4ffcf6

Please sign in to comment.