diff --git a/@stellar/anchor-tests/package.json b/@stellar/anchor-tests/package.json index 8449d4f..8b492b6 100644 --- a/@stellar/anchor-tests/package.json +++ b/@stellar/anchor-tests/package.json @@ -1,6 +1,6 @@ { "name": "@stellar/anchor-tests", - "version": "0.5.4", + "version": "0.5.5", "description": "stellar-anchor-tests is a library and command line interface for testing Stellar anchors.", "main": "./lib/index.js", "types": "./lib/index.d.ts", diff --git a/@stellar/anchor-tests/src/tests/sep12/deleteCustomer.ts b/@stellar/anchor-tests/src/tests/sep12/deleteCustomer.ts index a0f5a67..25e50d2 100644 --- a/@stellar/anchor-tests/src/tests/sep12/deleteCustomer.ts +++ b/@stellar/anchor-tests/src/tests/sep12/deleteCustomer.ts @@ -80,6 +80,10 @@ const canDeleteCustomer: Test = { "SEP-12 configuration data missing, expected 'deleteCustomer' in 'customers'", ); } + const customerToBeDeleted = + config.sepConfig["12"].customers[config.sepConfig["12"].deleteCustomer]; + + // PUT the customer const putCustomerCall = { request: new Request(this.context.expects.kycServerUrl + "/customer", { method: "PUT", @@ -89,9 +93,7 @@ const canDeleteCustomer: Test = { }, body: JSON.stringify({ account: clientKeypair.publicKey(), - ...config.sepConfig["12"].customers[ - config.sepConfig["12"].deleteCustomer - ], + ...customerToBeDeleted, }), }), }; @@ -103,10 +105,15 @@ const canDeleteCustomer: Test = { ); result.networkCalls.push(putCustomerCall); if (!putCustomerBody) return result; + + // GET the customer + const typeQueryParam = customerToBeDeleted.type + ? `&type=${customerToBeDeleted.type}` + : ""; const getCustomerCall: NetworkCall = { request: new Request( this.context.expects.kycServerUrl + - `/customer?account=${clientKeypair.publicKey()}`, + `/customer?account=${clientKeypair.publicKey()}${typeQueryParam}`, { headers: { Authorization: `Bearer ${token}`, @@ -117,6 +124,8 @@ const canDeleteCustomer: Test = { result.networkCalls.push(getCustomerCall); await makeRequest(getCustomerCall, 200, result); if (result.failure) return result; + + // DELETE the customer const deleteCustomerCall: NetworkCall = { request: new Request( this.context.expects.kycServerUrl + diff --git a/CHANGELOG.md b/CHANGELOG.md index bed0f56..b58d7d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ This changelog documents all releases and included changes to the @stellar/ancho A breaking change will get clearly marked in this log. +## [v0.5.5](https://github.com/stellar/stellar-anchor-tests/compare/v0.5.4...v0.5.5) + +### Fix + +- When deleting a user, send the customer type if available in the json body ([#101](https://github.com/stellar/stellar-anchor-tests/pull/101)). + ## [v0.5.4](https://github.com/stellar/stellar-anchor-tests/compare/v0.5.3...v0.5.4) ### Update diff --git a/server/package.json b/server/package.json index a180c7a..4c62554 100644 --- a/server/package.json +++ b/server/package.json @@ -24,7 +24,7 @@ }, "dependencies": { "@types/node": "^14.14.41", - "@stellar/anchor-tests": "0.5.2", + "@stellar/anchor-tests": "0.5.5", "express": "^4.17.1", "socket.io": "^4.1.2", "tslib": "^2.2.0",