From c41e4bf71955f771f23121650a99037a55fbbda2 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, 5 insertions(+), 8 deletions(-) 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(