Skip to content

Commit

Permalink
feature: implements feedback on release 2.5.0 (#1965)
Browse files Browse the repository at this point in the history
* Adds missing translations, updates portuguese

* updates snapshots

* Adds additional missing translations

* Updates snapshots

* Finishes feedback implementation

* Adds missing tooltip translations to activity page

* Updates snapshots
  • Loading branch information
comountainclimber authored Apr 14, 2020
1 parent 8ac695a commit 169266c
Show file tree
Hide file tree
Showing 59 changed files with 1,412 additions and 277 deletions.
25 changes: 21 additions & 4 deletions __tests__/components/Claim.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import { shallow, mount } from 'enzyme'
import { progressValues } from 'spunky'
import { injectIntl } from 'react-intl'

import { createStore, provideStore } from '../testHelpers'
import Claim from '../../app/containers/Claim/Claim'
Expand All @@ -9,6 +10,8 @@ import { DEFAULT_LANGUAGE } from '../../app/core/constants'

const { LOADED } = progressValues

const ClaimWithIntl = injectIntl(Claim)

const initialState = {
spunky: {
settings: {
Expand All @@ -22,6 +25,12 @@ const initialState = {
},
}

const INTL_STUB = {
noClaimableGas: 'Address has no claimable GAS',
claimTimeDisclaimer: 'You can claim GAS once every 5 minutes',
claimUnavailableInWatch: 'GAS claims are unavailable in Watch mode',
}

describe('Claim', () => {
const props = {
doGasClaim: () => {},
Expand All @@ -30,12 +39,20 @@ describe('Claim', () => {
}

test('should render claim GAS button as enabled', () => {
const wrapper = shallow(<Claim {...props} />)
const wrapper = shallow(
<Claim intl={{ formatMessage: id => INTL_STUB[id] }} {...props} />,
)
expect(wrapper).toMatchSnapshot()
})

test('should render claim GAS button as disabled', () => {
const wrapper = shallow(<Claim {...props} disableClaimButton />)
const wrapper = shallow(
<Claim
intl={{ formatMessage: id => INTL_STUB[id] }}
{...props}
disableClaimButton
/>,
)
expect(wrapper).toMatchSnapshot()
})

Expand All @@ -46,7 +63,7 @@ describe('Claim', () => {
const wrapper = mount(
provideStore(
<IntlWrapper>
<Claim {...props} doGasClaim={claimSpy} />
<ClaimWithIntl {...props} doGasClaim={claimSpy} />
</IntlWrapper>,
store,
),
Expand All @@ -66,7 +83,7 @@ describe('Claim', () => {
const wrapper = mount(
provideStore(
<IntlWrapper>
<Claim {...watchOnlyProps} doGasClaim={claimSpy} />
<ClaimWithIntl {...watchOnlyProps} doGasClaim={claimSpy} />
</IntlWrapper>,
store,
),
Expand Down
5 changes: 4 additions & 1 deletion __tests__/components/Send.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { uniqueId } from 'lodash-es'
import configureStore from 'redux-mock-store'
import { Provider } from 'react-redux'
import { progressValues } from 'spunky'
import { injectIntl } from 'react-intl'

import Send from '../../app/containers/Send/Send'
import ZeroAssets from '../../app/components/ZeroAssets/ZeroAssets'
Expand All @@ -28,12 +29,14 @@ const initialState = {
},
}

const SendWithIntl = injectIntl(Send)

const setup = props => {
const store = configureStore()(initialState)
const wrapper = mount(
<Provider store={store}>
<IntlWrapper>
<Send
<SendWithIntl
{...props}
sendableAssets={{ NEO: { balance: 5, symbol: 'NEO' } }}
prices={{ NEO: 38 }}
Expand Down
2 changes: 0 additions & 2 deletions __tests__/components/__snapshots__/Claim.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ exports[`Claim should render claim GAS button as disabled 1`] = `
<div>
<Tooltip
disabled={false}
title="You can claim GAS once every 5 minutes"
>
<Button
disabled={true}
Expand Down Expand Up @@ -32,7 +31,6 @@ exports[`Claim should render claim GAS button as enabled 1`] = `
<div>
<Tooltip
disabled={true}
title="You can claim GAS once every 5 minutes"
>
<Button
id="claim"
Expand Down
2 changes: 1 addition & 1 deletion __tests__/components/__snapshots__/LoginNep2.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`LoginNep2 renders without crashing 1`] = `
<withActions(Connect(withProgress(withProps(Connect(Connect(withError(Connect(withProgress(ErrorNotifier)))))))))
<withActions(Connect(withProgress(withProps(Connect(Connect(withError(Connect(withProgress(injectIntl(ErrorNotifier))))))))))
loginNep2={[Function]}
store={
Object {
Expand Down

Large diffs are not rendered by default.

49 changes: 48 additions & 1 deletion __tests__/components/__snapshots__/NetworkSwitch.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ exports[`NetworkSwitch renders without crashing 1`] = `
"authScanQRButton": "Scan QR",
"authWatch": "WATCH",
"authWatchPlaceholder": "Enter a NEO address here",
"automaticNodeSelectionTooltip": "Allow NEON to choose a node automatically",
"captureQR": "Capture",
"captureQRCaps": "CAPTURE",
"chooseAccount": "Choose an Existing Account",
"claimTimeDisclaimer": "You can claim GAS once every 5 minutes",
"claimUnavailableInWatch": "GAS claims are unavailable in Watch mode",
"completeExclaim": "Complete!",
"confirmAndSend": "Confirm & Send",
"confirmRemoveContact": "Please confirm removing contact",
Expand All @@ -51,6 +55,7 @@ exports[`NetworkSwitch renders without crashing 1`] = `
"contactName": "Name",
"contactWalletAddress": "Wallet Address",
"contactsPageLabel": "Manage Contacts",
"copyAddressTooltip": "Copy Wallet Address",
"copyCodeImage": "Copy Code Image",
"createANewWallet": "Create New Wallet",
"dashboardAddressLabel": "Address:",
Expand All @@ -70,6 +75,7 @@ exports[`NetworkSwitch renders without crashing 1`] = `
"dashboardTokenBalancesToken": "Token",
"dashboardValueLabel": "Total Wallet Value",
"deleteLabel": "Delete",
"depositAssets": "Deposit assets <b> compatible with the NEO blockchain </b> using your address:",
"editAContact": "Edit A Contact",
"editContactDisclaimer": "Please review and ensure that you have entered the address correctly to avoid loss of funds",
"editRecipients": "Edit Recipients",
Expand All @@ -85,6 +91,28 @@ exports[`NetworkSwitch renders without crashing 1`] = `
"encryptedKeyLabel": "ENCRYPTED KEY",
"enterAContactName": "Enter Contact Name...",
"enterAWalletAddress": "Enter Wallet Address...",
"errors.contact.contactExists": "You already have a contact with that address.",
"errors.contact.invalidAddress": "Address is not valid.",
"errors.contact.nameDupe": "You already have an account saved with that name.",
"errors.contact.nameLength": "Name is too long.",
"errors.contact.nameNull": "Name can't be null.",
"errors.encrypt.valid": "The private key is not valid.",
"errors.network.general": "Oops! Something went wrong...",
"errors.password.length": "Passphrase must contain at least {PASS_MIN_LENGTH, number} characters.",
"errors.password.match": "Passphrases must match.",
"errors.request.fractional": "You canot request fractional {asset}.",
"errors.request.max": "You cannot request more than 100,000,000 {asset}.",
"errors.request.min": "You cannot request 0 {asset}.",
"errors.request.validDecimals": "You can only request {asset} up to {validDecimals, number} decimals.",
"errors.send.balance": "You do not have enough balance to send {total} {asset}.",
"errors.send.blackListed": "Address is blacklisted. This is a known phishing address.",
"errors.send.decimal": "You can only send {asset} up to {decimalCount, number} decimals.",
"errors.send.fraction": "You cannot send fractional amounts of NEO.",
"errors.send.invalidAddress": "You need to specify a valid NEO address.",
"errors.send.negative": "You cannot send negative amounts of {asset}.",
"errors.send.network": "A network error has occurred",
"errors.send.number": "Amount must be a number.",
"errors.send.zero": "Can not send 0 {asset}.",
"fast": "Fast",
"faster": "Faster",
"fastest": "Fastest",
Expand All @@ -94,11 +122,12 @@ exports[`NetworkSwitch renders without crashing 1`] = `
"inputEncryptedPlaceholder": "Encrypted Key",
"inputPasswordPlaceholder": "Password",
"inputSelectPlaceholder": "Select",
"isLoadingMessage": "Loading...",
"manageWalletsCreate": "Create",
"manageWalletsEdit": "Edit",
"manageWalletsEditWallet": "Edit Wallet",
"manageWalletsEditWalletAddressLabel": "WALLET ADDRESS",
"manageWalletsEditWalletInstructions": "Moddify Details",
"manageWalletsEditWalletInstructions": "Modify Details",
"manageWalletsEditWalletNameLabel": "WALLET NAME",
"manageWalletsEditWalletNamePlaceholder": "Wallet Name",
"manageWalletsEditWalletSave": "Save Changes",
Expand All @@ -118,14 +147,25 @@ exports[`NetworkSwitch renders without crashing 1`] = `
"networkSettingsNodeSelectLabel": "NODE SELECTION",
"newContact": "New Contact",
"newsPageLabel": "News",
"nextStep": "Next Step",
"noAvailableAssetsToSend": "No available assets to send",
"noClaimableGas": "Address has no claimable GAS",
"noOptionsMessage": "No options",
"nodeSelectBlockHeight": "Block Height",
"nodeSelectInfo": "Top {nodeCount, number} nodes listed",
"nodeSelectPanelHeader": "Node Selection",
"nodeSelectSelectAutomatically": "Select automatically",
"nodeSelectionInstructions": "If you’re experiencing performance issues, try selecting a custom node below",
"nothingToSeeHere": "Nothing to see here!",
"notifications.success.accountSaved": "Account saved!",
"notifications.success.receivedBlockchainInfo": "Received latest blockchain information.",
"notifications.success.updatedWalletName": "Succesfully updated wallet name.",
"notificiations.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.",
"numberofTransactionsPending": "{transferCount, number} {transferCount, plural, one {Transfer} other {Transfers}} pending",
"previousStep": "Previous Step",
"print": "Print",
"priorityTransfer": "Priority Transfer",
"privateKey": "Private Key",
"privateKeyLabel": "PRIVATE KEY",
"publicAddress": "Public Address",
"receiveAssetsAddressLabel": "Your Public Address",
Expand Down Expand Up @@ -171,6 +211,7 @@ exports[`NetworkSwitch renders without crashing 1`] = `
"sendCompletion": "Complete! {transferCount, number} {transferCount, plural, one {sendAsset} other {sendAssets}} to {transferCount, plural, one {sendRecipient} other {sendRecipients}}",
"sendDisclaimer": "Please review and ensure that you have entered the correct details to avoid loss of funds.",
"sendEnterQRCode": "Enter QR Code",
"sendErrorLabel": "Error!",
"sendImport": "Import",
"sendMaxAmount": "MAX",
"sendMoreAssets": "Send More Assets",
Expand Down Expand Up @@ -209,6 +250,9 @@ exports[`NetworkSwitch renders without crashing 1`] = `
"sidebarTokenSale": "Token Sale",
"sidebarWallet": "Wallet",
"splitKeyLabel": "SPLIT KEY",
"splitKeyWalletInstructions": "The Split Key import option allows users to create a new NEO account by combining the private key of an existing account with a separate private key.",
"splitKeyWalletNamePlaceholder": "Enter your new split key wallet name...",
"takeMeBack": "Take me back",
"tokenSaleDisclaimer1": "Please read and acknowledge these statements to continue",
"tokenSaleDisclaimer2": "I understand that submitting NEO or GAS multiple times may result in a loss of funds or a delayed refund depending on the policy of the ICO company.",
"tokenSaleDisclaimer3": "I understand that some sales may only accept NEO or GAS, and I have verified which is accepted.",
Expand All @@ -230,6 +274,7 @@ exports[`NetworkSwitch renders without crashing 1`] = `
"walletImportedHeader": "Wallet Created!",
"walletManagerNoLocalInfo": "It looks like you have no wallet information saved locally...",
"walletManagerRemoveWallet": "Remove Wallet",
"walletQrCodes": "Wallet QR Codes",
}
}
onError={[Function]}
Expand Down Expand Up @@ -310,7 +355,9 @@ exports[`NetworkSwitch renders without crashing 1`] = `
defaultValue={null}
hideHighlight={true}
isSearchable={false}
loadingMessage={[Function]}
maxMenuHeight={140}
noOptionsMessage={[Function]}
onChange={[Function]}
options={
Array [
Expand Down
47 changes: 46 additions & 1 deletion __tests__/components/__snapshots__/News.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ exports[`News renders without crashing 1`] = `
"authScanQRButton": "Scan QR",
"authWatch": "WATCH",
"authWatchPlaceholder": "Enter a NEO address here",
"automaticNodeSelectionTooltip": "Allow NEON to choose a node automatically",
"captureQR": "Capture",
"captureQRCaps": "CAPTURE",
"chooseAccount": "Choose an Existing Account",
"claimTimeDisclaimer": "You can claim GAS once every 5 minutes",
"claimUnavailableInWatch": "GAS claims are unavailable in Watch mode",
"completeExclaim": "Complete!",
"confirmAndSend": "Confirm & Send",
"confirmRemoveContact": "Please confirm removing contact",
Expand All @@ -69,6 +73,7 @@ exports[`News renders without crashing 1`] = `
"contactName": "Name",
"contactWalletAddress": "Wallet Address",
"contactsPageLabel": "Manage Contacts",
"copyAddressTooltip": "Copy Wallet Address",
"copyCodeImage": "Copy Code Image",
"createANewWallet": "Create New Wallet",
"dashboardAddressLabel": "Address:",
Expand All @@ -88,6 +93,7 @@ exports[`News renders without crashing 1`] = `
"dashboardTokenBalancesToken": "Token",
"dashboardValueLabel": "Total Wallet Value",
"deleteLabel": "Delete",
"depositAssets": "Deposit assets <b> compatible with the NEO blockchain </b> using your address:",
"editAContact": "Edit A Contact",
"editContactDisclaimer": "Please review and ensure that you have entered the address correctly to avoid loss of funds",
"editRecipients": "Edit Recipients",
Expand All @@ -103,6 +109,28 @@ exports[`News renders without crashing 1`] = `
"encryptedKeyLabel": "ENCRYPTED KEY",
"enterAContactName": "Enter Contact Name...",
"enterAWalletAddress": "Enter Wallet Address...",
"errors.contact.contactExists": "You already have a contact with that address.",
"errors.contact.invalidAddress": "Address is not valid.",
"errors.contact.nameDupe": "You already have an account saved with that name.",
"errors.contact.nameLength": "Name is too long.",
"errors.contact.nameNull": "Name can't be null.",
"errors.encrypt.valid": "The private key is not valid.",
"errors.network.general": "Oops! Something went wrong...",
"errors.password.length": "Passphrase must contain at least {PASS_MIN_LENGTH, number} characters.",
"errors.password.match": "Passphrases must match.",
"errors.request.fractional": "You canot request fractional {asset}.",
"errors.request.max": "You cannot request more than 100,000,000 {asset}.",
"errors.request.min": "You cannot request 0 {asset}.",
"errors.request.validDecimals": "You can only request {asset} up to {validDecimals, number} decimals.",
"errors.send.balance": "You do not have enough balance to send {total} {asset}.",
"errors.send.blackListed": "Address is blacklisted. This is a known phishing address.",
"errors.send.decimal": "You can only send {asset} up to {decimalCount, number} decimals.",
"errors.send.fraction": "You cannot send fractional amounts of NEO.",
"errors.send.invalidAddress": "You need to specify a valid NEO address.",
"errors.send.negative": "You cannot send negative amounts of {asset}.",
"errors.send.network": "A network error has occurred",
"errors.send.number": "Amount must be a number.",
"errors.send.zero": "Can not send 0 {asset}.",
"fast": "Fast",
"faster": "Faster",
"fastest": "Fastest",
Expand All @@ -112,11 +140,12 @@ exports[`News renders without crashing 1`] = `
"inputEncryptedPlaceholder": "Encrypted Key",
"inputPasswordPlaceholder": "Password",
"inputSelectPlaceholder": "Select",
"isLoadingMessage": "Loading...",
"manageWalletsCreate": "Create",
"manageWalletsEdit": "Edit",
"manageWalletsEditWallet": "Edit Wallet",
"manageWalletsEditWalletAddressLabel": "WALLET ADDRESS",
"manageWalletsEditWalletInstructions": "Moddify Details",
"manageWalletsEditWalletInstructions": "Modify Details",
"manageWalletsEditWalletNameLabel": "WALLET NAME",
"manageWalletsEditWalletNamePlaceholder": "Wallet Name",
"manageWalletsEditWalletSave": "Save Changes",
Expand All @@ -136,14 +165,25 @@ exports[`News renders without crashing 1`] = `
"networkSettingsNodeSelectLabel": "NODE SELECTION",
"newContact": "New Contact",
"newsPageLabel": "News",
"nextStep": "Next Step",
"noAvailableAssetsToSend": "No available assets to send",
"noClaimableGas": "Address has no claimable GAS",
"noOptionsMessage": "No options",
"nodeSelectBlockHeight": "Block Height",
"nodeSelectInfo": "Top {nodeCount, number} nodes listed",
"nodeSelectPanelHeader": "Node Selection",
"nodeSelectSelectAutomatically": "Select automatically",
"nodeSelectionInstructions": "If you’re experiencing performance issues, try selecting a custom node below",
"nothingToSeeHere": "Nothing to see here!",
"notifications.success.accountSaved": "Account saved!",
"notifications.success.receivedBlockchainInfo": "Received latest blockchain information.",
"notifications.success.updatedWalletName": "Succesfully updated wallet name.",
"notificiations.failure.blockchainInfoFailure": "Failed to retrieve blockchain information.",
"numberofTransactionsPending": "{transferCount, number} {transferCount, plural, one {Transfer} other {Transfers}} pending",
"previousStep": "Previous Step",
"print": "Print",
"priorityTransfer": "Priority Transfer",
"privateKey": "Private Key",
"privateKeyLabel": "PRIVATE KEY",
"publicAddress": "Public Address",
"receiveAssetsAddressLabel": "Your Public Address",
Expand Down Expand Up @@ -189,6 +229,7 @@ exports[`News renders without crashing 1`] = `
"sendCompletion": "Complete! {transferCount, number} {transferCount, plural, one {sendAsset} other {sendAssets}} to {transferCount, plural, one {sendRecipient} other {sendRecipients}}",
"sendDisclaimer": "Please review and ensure that you have entered the correct details to avoid loss of funds.",
"sendEnterQRCode": "Enter QR Code",
"sendErrorLabel": "Error!",
"sendImport": "Import",
"sendMaxAmount": "MAX",
"sendMoreAssets": "Send More Assets",
Expand Down Expand Up @@ -227,6 +268,9 @@ exports[`News renders without crashing 1`] = `
"sidebarTokenSale": "Token Sale",
"sidebarWallet": "Wallet",
"splitKeyLabel": "SPLIT KEY",
"splitKeyWalletInstructions": "The Split Key import option allows users to create a new NEO account by combining the private key of an existing account with a separate private key.",
"splitKeyWalletNamePlaceholder": "Enter your new split key wallet name...",
"takeMeBack": "Take me back",
"tokenSaleDisclaimer1": "Please read and acknowledge these statements to continue",
"tokenSaleDisclaimer2": "I understand that submitting NEO or GAS multiple times may result in a loss of funds or a delayed refund depending on the policy of the ICO company.",
"tokenSaleDisclaimer3": "I understand that some sales may only accept NEO or GAS, and I have verified which is accepted.",
Expand All @@ -248,6 +292,7 @@ exports[`News renders without crashing 1`] = `
"walletImportedHeader": "Wallet Created!",
"walletManagerNoLocalInfo": "It looks like you have no wallet information saved locally...",
"walletManagerRemoveWallet": "Remove Wallet",
"walletQrCodes": "Wallet QR Codes",
}
}
onError={[Function]}
Expand Down
Loading

0 comments on commit 169266c

Please sign in to comment.