diff --git a/cashtab/package-lock.json b/cashtab/package-lock.json --- a/cashtab/package-lock.json +++ b/cashtab/package-lock.json @@ -1,12 +1,12 @@ { "name": "cashtab", - "version": "3.2.2", + "version": "3.2.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cashtab", - "version": "3.2.2", + "version": "3.2.3", "dependencies": { "@bitgo/utxo-lib": "^11.0.0", "@zxing/browser": "^0.1.4", diff --git a/cashtab/package.json b/cashtab/package.json --- a/cashtab/package.json +++ b/cashtab/package.json @@ -1,6 +1,6 @@ { "name": "cashtab", - "version": "3.2.2", + "version": "3.2.3", "private": true, "scripts": { "start": "node scripts/start.js", diff --git a/cashtab/src/components/Common/Inputs.tsx b/cashtab/src/components/Common/Inputs.tsx --- a/cashtab/src/components/Common/Inputs.tsx +++ b/cashtab/src/components/Common/Inputs.tsx @@ -196,6 +196,7 @@ value: null | string; handleInput: React.ChangeEventHandler<HTMLInputElement>; error: string | boolean; + type?: string; } export const ModalInput: React.FC<ModalInputProps> = ({ placeholder = '', @@ -203,6 +204,7 @@ value = '', handleInput, error = false, + type = 'text', }) => { return ( <CashtabInputWrapper> @@ -213,6 +215,7 @@ placeholder={placeholder} invalid={typeof error === 'string'} onChange={e => handleInput(e)} + type={type} /> </InputRow> <ErrorMsg>{typeof error === 'string' ? error : ''}</ErrorMsg> diff --git a/cashtab/src/components/OnBoarding/__tests__/index.test.js b/cashtab/src/components/OnBoarding/__tests__/index.test.js --- a/cashtab/src/components/OnBoarding/__tests__/index.test.js +++ b/cashtab/src/components/OnBoarding/__tests__/index.test.js @@ -125,7 +125,9 @@ // The validation msg is in the document expect( - screen.getByText('Invalid 12-word mnemonic'), + screen.getByText( + 'Invalid 12-word mnemonic. Note: all letters must be lowercase.', + ), ).toBeInTheDocument(); // Type in the rest @@ -136,7 +138,9 @@ // The validation msg is not in the document expect( - screen.queryByText('Invalid 12-word mnemonic'), + screen.queryByText( + 'Invalid 12-word mnemonic. Note: all letters must be lowercase.', + ), ).not.toBeInTheDocument(); // The button is not disabled diff --git a/cashtab/src/components/OnBoarding/index.js b/cashtab/src/components/OnBoarding/index.js --- a/cashtab/src/components/OnBoarding/index.js +++ b/cashtab/src/components/OnBoarding/index.js @@ -68,7 +68,9 @@ name="mnemonic" value={importedMnemonic} error={ - isValidMnemonic ? false : 'Invalid 12-word mnemonic' + isValidMnemonic + ? false + : 'Invalid 12-word mnemonic. Note: all letters must be lowercase.' } handleInput={handleInput} /> diff --git a/cashtab/src/components/Wallets/__tests__/index.test.js b/cashtab/src/components/Wallets/__tests__/index.test.js --- a/cashtab/src/components/Wallets/__tests__/index.test.js +++ b/cashtab/src/components/Wallets/__tests__/index.test.js @@ -376,7 +376,11 @@ 'pioneer waste next tired armed course expand stairs load brick asthma ', ); // The validation msg is in the document - expect(screen.getByText('Invalid mnemonic')).toBeInTheDocument(); + expect( + screen.getByText( + 'Invalid 12-word mnemonic. Note: all letters must be lowercase.', + ), + ).toBeInTheDocument(); // Type in the rest await user.type( @@ -385,7 +389,11 @@ ); // The validation msg is not in the document - expect(screen.queryByText('Invalid mnemonic')).not.toBeInTheDocument(); + expect( + screen.queryByText( + 'Invalid 12-word mnemonic. Note: all letters must be lowercase.', + ), + ).not.toBeInTheDocument(); // The button is not disabled expect(importBtn).toHaveProperty('disabled', false); diff --git a/cashtab/src/components/Wallets/index.js b/cashtab/src/components/Wallets/index.js --- a/cashtab/src/components/Wallets/index.js +++ b/cashtab/src/components/Wallets/index.js @@ -101,7 +101,7 @@ [name]: validateMnemonic(value) === true ? false - : 'Invalid mnemonic', + : 'Invalid 12-word mnemonic. Note: all letters must be lowercase.', })); } setFormData(previous => ({