with the different response bodies for each case. I.e.
{
"flagAsDangerous":1,
"reason":"Approval is to an unverified smart contract known for stealing NFTs in the past.",
"reason_header":"This could be a scam"
}
There is a good example of mocking a response API on the phishing-detection.spec.js.
One last recommendation, we should enable the feature transactionSecurityCheckEnabled using fixtures, instead of going to Settings and Enabling the toggle. This way we can skip steps on our tests.
This can be done using fixture-builder.js. See examples on other tests, like address-book.js where we add an address using the fixture builder.
We should verify that we cover the different cases of Opensea responses:
For that, we should mock the API response for this request:
with the different response bodies for each case. I.e.
There is a good example of mocking a response API on the
phishing-detection.spec.js
.One last recommendation, we should enable the feature
transactionSecurityCheckEnabled
using fixtures, instead of going to Settings and Enabling the toggle. This way we can skip steps on our tests. This can be done usingfixture-builder.js
. See examples on other tests, likeaddress-book.js
where we add an address using the fixture builder.cc @bschorchit