From d33453840d8fe3ffdc8de8d34bf4b991f8ded36a Mon Sep 17 00:00:00 2001 From: Miguel de Barros Date: Fri, 25 Feb 2022 13:43:34 +0200 Subject: [PATCH] fix: bulk tests (#65) - split up bulk positive test assertions from using JSON.stringify which will fail since the ordering of JSON elements are not guaranteed --- .../other_tests/bulk_transfers/positive_scenarios.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/collections/hub/other_tests/bulk_transfers/positive_scenarios.json b/collections/hub/other_tests/bulk_transfers/positive_scenarios.json index 39ae11bf..0cf2afa6 100644 --- a/collections/hub/other_tests/bulk_transfers/positive_scenarios.json +++ b/collections/hub/other_tests/bulk_transfers/positive_scenarios.json @@ -323,7 +323,8 @@ "description": "payeefsp request - 1st individual transfer should have valid transferAmount", "exec": [ "const transfer1 = environment.bulkTransfersNegativeRequest.data.individualTransfers.find(t => t.transferId === environment.transferId);", - "expect(JSON.stringify(transfer1.transferAmount)).to.equal(JSON.stringify({ amount: \"1\", currency: \"USD\" }))" + "", + "expect(transfer1.transferAmount.amount).to.equal(\"1\") && expect(transfer1.transferAmount.currency).to.equal(\"USD\")" ] }, { @@ -355,7 +356,8 @@ "description": "payeefsp request - 2nd individual transfer should have valid transferAmount", "exec": [ "const transfer2 = environment.bulkTransfersNegativeRequest.data.individualTransfers.find(t => t.transferId === environment.transferId2)", - "expect(JSON.stringify(transfer2.transferAmount)).to.equal(JSON.stringify({ amount: \"1\", currency: \"USD\" }))" + "", + "expect(transfer2.transferAmount.amount).to.equal(\"1\") && expect(transfer2.transferAmount.currency).to.equal(\"USD\")" ] } ] @@ -395,7 +397,8 @@ "if (environment.ENABLE_WS_ASSERTIONS===true) {", " environment.bulkTransfersNegativeRequest = await websocket.getMessage('payeeRequest', environment.WS_ASSERTION_TIMEOUT)", " environment.bulkTransfersNegativeCallback = await websocket.getMessage('payeeCallback', environment.WS_ASSERTION_TIMEOUT)", - "}" + "}", + "" ] } }