From f17c37fcd3cc3949af2d0a2c5f0ee8179e110c26 Mon Sep 17 00:00:00 2001 From: Juiced66 Date: Wed, 30 Oct 2024 12:38:00 +0100 Subject: [PATCH] tests: fix legacy test --- features/step_definitions/auth-steps.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/features/step_definitions/auth-steps.js b/features/step_definitions/auth-steps.js index 2acdd73603..541c8f288a 100644 --- a/features/step_definitions/auth-steps.js +++ b/features/step_definitions/auth-steps.js @@ -27,21 +27,20 @@ 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"); + 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(