diff --git a/tauri-wallet/src/components/Confirmation.tsx b/tauri-wallet/src/components/Confirmation.tsx index 593eed90af..87c570b84c 100644 --- a/tauri-wallet/src/components/Confirmation.tsx +++ b/tauri-wallet/src/components/Confirmation.tsx @@ -33,7 +33,7 @@ export const Confirmation = ({ {error === null ? ( SuccessMessage ) : ( - + {error.name} {failureMessage} - {error.message} diff --git a/tauri-wallet/src/components/CopyToClipboard.tsx b/tauri-wallet/src/components/CopyToClipboard.tsx index c1c6da79d2..c09edfe287 100644 --- a/tauri-wallet/src/components/CopyToClipboard.tsx +++ b/tauri-wallet/src/components/CopyToClipboard.tsx @@ -40,6 +40,7 @@ export const CopyToClipboard = ({ text }: { text: string }) => { size="small" variant={copied ? 'text' : 'outlined'} aria-label="save" + data-testid="copyButton" onClick={() => handleCopy({ text, cb: updateCopyStatus })} endIcon={copied && } style={copied ? { background: green[500], color: 'white' } : {}} diff --git a/tauri-wallet/src/components/Error.tsx b/tauri-wallet/src/components/Error.tsx index 0537674d8b..cb211269d4 100644 --- a/tauri-wallet/src/components/Error.tsx +++ b/tauri-wallet/src/components/Error.tsx @@ -6,11 +6,11 @@ import { Button } from '@material-ui/core' export const ErrorFallback = ({ error, resetErrorBoundary }: FallbackProps) => { return (
- + {error.name} {error.message} - + Stack trace {error.stack} diff --git a/tauri-wallet/src/components/Nav.tsx b/tauri-wallet/src/components/Nav.tsx index 3e870e4edd..ba60e4d162 100644 --- a/tauri-wallet/src/components/Nav.tsx +++ b/tauri-wallet/src/components/Nav.tsx @@ -131,7 +131,7 @@ export const Nav = () => { )} - + { noPadding Action={ - + @@ -71,6 +71,7 @@ export const AddressCard = () => { title="Address" subheader="Wallet payments address" noPadding + data-testid="walletAddressHeader" Action={ @@ -106,7 +107,7 @@ export const AddressCard = () => { } > - {truncate(clientDetails?.client_address!, 35)} diff --git a/tauri-wallet/src/components/NoClientError.tsx b/tauri-wallet/src/components/NoClientError.tsx index 9e1022babb..b703832aee 100644 --- a/tauri-wallet/src/components/NoClientError.tsx +++ b/tauri-wallet/src/components/NoClientError.tsx @@ -5,7 +5,7 @@ import { Alert, AlertTitle } from '@material-ui/lab' export const NoClientError = () => { return ( - No client detected + No client detected Have you signed in? Try to go back to{' '} the main page and try again diff --git a/tauri-wallet/src/components/NodeTypeSelector.tsx b/tauri-wallet/src/components/NodeTypeSelector.tsx index b949eb00d3..3f068680b3 100644 --- a/tauri-wallet/src/components/NodeTypeSelector.tsx +++ b/tauri-wallet/src/components/NodeTypeSelector.tsx @@ -34,11 +34,13 @@ export const NodeTypeSelector = ({ value={EnumNodeType.mixnode} control={} label="Mixnode" + data-testid="mixNode" disabled={disabled} /> } + data-testid="gateWay" label="Gateway" disabled={disabled} /> diff --git a/tauri-wallet/src/routes/balance.tsx b/tauri-wallet/src/routes/balance.tsx index b14fba3270..6ffbf480b9 100644 --- a/tauri-wallet/src/routes/balance.tsx +++ b/tauri-wallet/src/routes/balance.tsx @@ -31,12 +31,13 @@ export const Balance = () => { return ( - + {error && ( } style={{ padding: theme.spacing(2) }} > @@ -46,6 +47,7 @@ export const Balance = () => { {!error && ( } > diff --git a/tauri-wallet/src/routes/bond/BondForm.tsx b/tauri-wallet/src/routes/bond/BondForm.tsx index 8d1152bed9..06936f86ee 100644 --- a/tauri-wallet/src/routes/bond/BondForm.tsx +++ b/tauri-wallet/src/routes/bond/BondForm.tsx @@ -142,7 +142,7 @@ export const BondForm = ({ {fees && ( - + {`A fee of ${ watchNodeType === EnumNodeType.mixnode ? fees.mixnode.amount @@ -369,6 +369,7 @@ export const BondForm = ({ color="primary" type="submit" size="large" + data-testid="submitButton" disableElevation onClick={handleSubmit(onSubmit)} endIcon={isSubmitting && } diff --git a/tauri-wallet/src/routes/bond/index.tsx b/tauri-wallet/src/routes/bond/index.tsx index 1c06f9051e..cf11a2c712 100644 --- a/tauri-wallet/src/routes/bond/index.tsx +++ b/tauri-wallet/src/routes/bond/index.tsx @@ -43,7 +43,7 @@ export const Bond = () => { {ownership?.hasOwnership && ( { getBalance.fetchBalance() setStatus(EnumRequestStatus.initial) }} + data-testid="unBond" > Unbond @@ -93,10 +94,10 @@ export const Bond = () => { Successfully bonded node + Successfully bonded node } Error={ - + An error occurred with the request: {message} } diff --git a/tauri-wallet/src/routes/delegate/DelegateForm.tsx b/tauri-wallet/src/routes/delegate/DelegateForm.tsx index 50fb7a4929..2aabc04ae7 100644 --- a/tauri-wallet/src/routes/delegate/DelegateForm.tsx +++ b/tauri-wallet/src/routes/delegate/DelegateForm.tsx @@ -97,7 +97,7 @@ export const DelegateForm = ({ /> - + {`A fee of ${ watchNodeType === EnumNodeType.mixnode ? fees.mixnode.amount @@ -153,6 +153,7 @@ export const DelegateForm = ({
- {data.to_address} + {data.to_address}
@@ -70,7 +70,7 @@ export const SendConfirmation = ({
- {data.amount.amount + ' punks'} + {data.amount.amount + ' punks'}
diff --git a/tauri-wallet/src/routes/send/SendError.tsx b/tauri-wallet/src/routes/send/SendError.tsx index 2fcb9ce5be..644067e432 100644 --- a/tauri-wallet/src/routes/send/SendError.tsx +++ b/tauri-wallet/src/routes/send/SendError.tsx @@ -37,7 +37,7 @@ export const SendError = ({ message }: { message?: string }) => { variant="outlined" style={{ width: '100%', padding: theme.spacing(2) }} > - + An error occured during the request {message} diff --git a/tauri-wallet/src/routes/send/SendReview.tsx b/tauri-wallet/src/routes/send/SendReview.tsx index e9d0e23095..0b31454d3d 100644 --- a/tauri-wallet/src/routes/send/SendReview.tsx +++ b/tauri-wallet/src/routes/send/SendReview.tsx @@ -44,19 +44,19 @@ export const SendReview = () => { ) : ( - + - + - + @@ -65,6 +65,7 @@ export const SendReview = () => { diff --git a/tauri-wallet/src/routes/send/SendWizard.tsx b/tauri-wallet/src/routes/send/SendWizard.tsx index ee03bab9aa..65ed2f9c97 100644 --- a/tauri-wallet/src/routes/send/SendWizard.tsx +++ b/tauri-wallet/src/routes/send/SendWizard.tsx @@ -148,6 +148,7 @@ export const SendWizard = () => { disableElevation style={{ marginRight: theme.spacing(1) }} onClick={handlePreviousStep} + data-testid="backButton" > Back @@ -156,6 +157,7 @@ export const SendWizard = () => { variant={activeStep > 0 ? 'contained' : 'text'} color={activeStep > 0 ? 'primary' : 'default'} disableElevation + data-testid="button" onClick={ activeStep === 0 ? handleNextStep diff --git a/tauri-wallet/src/routes/sign-in.tsx b/tauri-wallet/src/routes/sign-in.tsx index d80a81060f..14670f9b63 100644 --- a/tauri-wallet/src/routes/sign-in.tsx +++ b/tauri-wallet/src/routes/sign-in.tsx @@ -239,7 +239,7 @@ const CreateAccountContent = ({ showSignIn }: { showSignIn: () => void }) => { /> Wallet setup complete - + Please store your mnemonic in a safe place. You'll need it to access your wallet @@ -257,7 +257,7 @@ const CreateAccountContent = ({ showSignIn }: { showSignIn: () => void }) => { - {accountDetails.mnemonic} + {accountDetails.mnemonic}
@@ -273,7 +273,7 @@ const CreateAccountContent = ({ showSignIn }: { showSignIn: () => void }) => { - {accountDetails.client_address} + {accountDetails.client_address} @@ -282,7 +282,7 @@ const CreateAccountContent = ({ showSignIn }: { showSignIn: () => void }) => { {error && ( - {error} + {error} )} @@ -293,6 +293,7 @@ const CreateAccountContent = ({ showSignIn }: { showSignIn: () => void }) => { variant="contained" color="primary" type="submit" + data-testid="createButton" disableElevation style={{ marginBottom: theme.spacing(1) }} disabled={isLoading} @@ -304,6 +305,7 @@ const CreateAccountContent = ({ showSignIn }: { showSignIn: () => void }) => { fullWidth variant="text" onClick={showSignIn} + data-testid="signInButton" startIcon={} > Sign in diff --git a/tauri-wallet/src/routes/unbond/index.tsx b/tauri-wallet/src/routes/unbond/index.tsx index 9ae5ed6f01..36b7756603 100644 --- a/tauri-wallet/src/routes/unbond/index.tsx +++ b/tauri-wallet/src/routes/unbond/index.tsx @@ -29,8 +29,10 @@ export const Unbond = () => { {ownership?.hasOwnership && ( { setIsLoading(true) @@ -48,7 +50,7 @@ export const Unbond = () => { )} {!ownership.hasOwnership && ( - + You don't currently have a bonded node )} diff --git a/tauri-wallet/src/routes/undelegate/UndelegateForm.tsx b/tauri-wallet/src/routes/undelegate/UndelegateForm.tsx index cd41145aa6..f897851da0 100644 --- a/tauri-wallet/src/routes/undelegate/UndelegateForm.tsx +++ b/tauri-wallet/src/routes/undelegate/UndelegateForm.tsx @@ -84,7 +84,7 @@ export const UndelegateForm = ({ /> - + {`A fee of ${ watchNodeType === EnumNodeType.mixnode ? fees.mixnode.amount @@ -140,6 +140,7 @@ export const UndelegateForm = ({ variant="contained" color="primary" type="submit" + data-testid="submitButton" disableElevation disabled={isSubmitting} endIcon={isSubmitting && } diff --git a/tauri-wallet/src/routes/undelegate/index.tsx b/tauri-wallet/src/routes/undelegate/index.tsx index 456285d980..bd9208f1ba 100644 --- a/tauri-wallet/src/routes/undelegate/index.tsx +++ b/tauri-wallet/src/routes/undelegate/index.tsx @@ -102,14 +102,14 @@ export const Undelegate = () => { + An error occurred with the request: {message} } Success={ {' '} - Undelegation complete + Undelegation complete {message} } @@ -125,6 +125,7 @@ export const Undelegate = () => { }} >