diff --git a/features/step_definitions/auth-steps.js b/features/step_definitions/auth-steps.js index 2acdd73603..391b18554e 100644 --- a/features/step_definitions/auth-steps.js +++ b/features/step_definitions/auth-steps.js @@ -27,21 +27,18 @@ Given( should(token).not.be.undefined(); this.sdk.jwt = token; - - const { valid } = await this.sdk.auth.checkToken(); - - this.sdk.jwt = previousToken; - - if (not) { - should(valid).be.false("Provided token is valid"); + if(not) { + should(await this.sdk.auth.checkToken()).throwError({ id: "services.storage.not_found" }); } else { + const { valid } = await this.sdk.auth.checkToken(); + this.sdk.jwt = previousToken; should(valid).be.true("Provided token is invalid"); } }, ); Given("I save the created API key", function () { - this.props.token = this.props.result._source.token; + this.props.token = this.props.result.token; }); Given(