Added function + tests in validation.js & validation.test.js that handles checking new wallet name length. Related to T2409.
Details
- Reviewers
bytesofman - Group Reviewers
Restricted Project - Commits
- rABCb5e7871c0996: [Cashtab] Validation function for new wallet name length
cd web/cashtab && npm start
navigate to configure screen
ensure there is at least one wallet in saved wallets list
click rename wallet button
enter a wallet name longer than 24 characters
observe that the error message for a wallet name that is too long will appear when max character limit is exceeded
backspace the wallet name until there are 0 characters left in the input
observe that the error message displays when the wallet name is 0 characters long
enter a valid wallet name to the input
observe that the wallet name successfully updates on Ok.
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- wallet-length-validation-func
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 19798 Build 39310: Build Diff cashtab-tests Build 39309: arc lint + arc unit
Event Timeline
web/cashtab/src/utils/validation.js | ||
---|---|---|
397 ↗ | (On Diff #34605) | This can follow the barebones model of other functions in validation.js that simply return e.g. export const isValidNewWalletNameLength = newWalletName => { return ( typeof newWalletName === 'string' && newWalletName.length > 0 && newWalletName.length <= currency.localStorageMaxCharacters && newWalletName.length !== '' ) } Test the above approach |
web/cashtab/src/components/Configure/Configure.js | ||
---|---|---|
152 ↗ | (On Diff #34605) | Why is this showing removed? Rebase to latest master |
web/cashtab/src/utils/__tests__/validation.test.js | ||
---|---|---|
699 | add a unit test where newWalletName is an array that meets all conditoins except for typeof newWalletName === 'string' so, an array with length > 0 and length < currency.localStorageMaxCharacters |