Check the mnemonic hide/show and update features.
Details
- Reviewers
bytesofman - Group Reviewers
Restricted Project - Commits
- rABCafd3aa29befb: [marlin] Add mnemonic end to end tests
pnpm run test:e2e
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
| apps/marlin-wallet/web/cypress/e2e/mnemonic.cy.ts | ||
|---|---|---|
| 5 ↗ | (On Diff #58950) | cashtab does not use the bip39 dependency as all the logic needed is available in ecash-lib however you do need to include the english wordlist somewhere here to lose the dep; not necessarily related to this diff but opportunity to lose a critical external dep |
| 53 ↗ | (On Diff #58950) | not sure what we gain by testing this; of course we expect the app to never have an invalid mnemonic would make more sense to test this kind of behavior on import, e.g. we correctly throw or show correct validation error if user attempts to import an invalid mnemonic |
| 150 ↗ | (On Diff #58950) | it's usually a bad sign if arbitrary timeouts are in like this, especially one for 60s. If this is failing without the timeout there could be some other issue, but more likely the expectation should simply be cleaned up somehow. cypress has async expectors (I think this is one). It's possible there is some need for longer timeouts for CI processing, but this should be handled at he CI config level, not hard coded timeouts on individual checks |
| 163 ↗ | (On Diff #58950) | again here, not sure testing isValidMnemonic at this stage is useful or relevant to app performance. We shouldn't really be using isValidMnemonic in the test file at all. A test that would make sense would be
current use of this function is not adding value to the test |
| apps/marlin-wallet/web/cypress/e2e/mnemonic.cy.ts | ||
|---|---|---|
| 5 ↗ | (On Diff #58950) | Good point, I should update marlin to remove the dependency. This will be another diff tho as it's unrelated |
| 53 ↗ | (On Diff #58950) | it's more about checking the settings is properly showing the mnemonic. Since we don't know what it's supposed to be (it's random), checking it's valid (so 12 words from the list) is a good enough approximation. The import is tested in another case a bit below and this time all the words are also checked as well as the corresponding address. |
| 150 ↗ | (On Diff #58950) | This timeout might not be needed as it's the default anyway, but yes I need an async expector here because the wallet refreshes so there might be a small delay before the address is updated |
| 163 ↗ | (On Diff #58950) | I agree here, the point is to test the words are the expected ones, not that the mnemonic is valid. |
Remove the unnecessary timeout and mnemonic validation.
I kept the mnemonic validation as a way to check a mnemonic is visible.
Added a couple more tests for 1. invalid mnemonic and 2. words autocompletion