Files
app-ethereum/tests/src/approve.test.js
Jean P fa355a5d97 Add a UI warning when contract data are not enabled in the settings (#193)
* Add a UI warning when contract data are not enabled in the settings

* Update wording "contract data" -> "blind signing" to raise awareness

* Bump version 1.9.5

* remove hardcoded path in helper build script

* Add blind signature test

* Add snapshot-tmp to gitignore

* Remove unused snapshots

* Increase tests timings

* Remove unused snapshots

* Fix and rename compound blind deposit test

* Update Approve and Transfer tests

* Update tests

* Cosmetic changes + disable debug flag

* Update CHANGELOG.md
2021-09-28 12:32:06 +02:00

38 lines
1.5 KiB
JavaScript

import "core-js/stable";
import "regenerator-runtime/runtime";
import { waitForAppScreen, zemu } from './test.fixture';
test('[Nano S] Approve DAI tokens', zemu("nanos", async (sim, eth) => {
const tx = eth.signTransaction(
"44'/60'/1'/0/0",
'F869468506A8B15E0082EBEB946B175474E89094C44DA98B954EEDEAC495271D0F80B844095EA7B30000000000000000000000007D2768DE32B0B80B7A3454C06BDAC94A69DDC7A9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF018080',
);
await waitForAppScreen(sim);
await sim.navigateAndCompareSnapshots('.', 'nanos_approve_dai_tokens', [7, 0]);
await expect(tx).resolves.toEqual({
"r": "92243511396b65a4faa735a5472ea99b3ce0f7f2338eab426206730bc0ddc57f",
"s": "161bc0f861064d840de4f4304cfd19a571017e62df7d8f70cf605c0f025593b6",
"v": "25",
});
}));
test('[Nano X] Approve DAI tokens', zemu("nanox", async (sim, eth) => {
const tx = eth.signTransaction(
"44'/60'/1'/0/0",
'F869468506A8B15E0082EBEB946B175474E89094C44DA98B954EEDEAC495271D0F80B844095EA7B30000000000000000000000007D2768DE32B0B80B7A3454C06BDAC94A69DDC7A9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF018080',
);
await waitForAppScreen(sim);
await sim.navigateAndCompareSnapshots('.', 'nanox_approve_dai_tokens', [5, 0]);
await expect(tx).resolves.toEqual({
"r": "92243511396b65a4faa735a5472ea99b3ce0f7f2338eab426206730bc0ddc57f",
"s": "161bc0f861064d840de4f4304cfd19a571017e62df7d8f70cf605c0f025593b6",
"v": "25",
});
}));