To avoid confusion, as the user inputs an amount into the send form, they are shown the value formatted to their locale in the space beneath the input area.
Details
- Reviewers
bytesofman - Group Reviewers
Restricted Project - Commits
- rABC91273a0907ce: [Cashtab] Format XEC on send form
cd web/cashtab && npm start
navigate to send tab
input an amount with more tha 3 digits
ensure formatting is taking place
in browser settings, change preferred language
navigate to send tab
input an amount that is more than 3 digits
ensure formatting meets the requirements for your selected locale
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- locale-formatting-send-form
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 17811 Build 35448: Build Diff cashtab-tests Build 35447: arc lint + arc unit
Event Timeline
Failed tests logs:
====== CashTab Unit Tests: Wallet without BCH balance ====== Error: expect(received).toMatchSnapshot() Snapshot name: `Wallet without BCH balance 1` - Snapshot - 0 + Received + 7 @@ -319,10 +319,17 @@ </div> </div> </div> </div> </div> + <h3 + className="sc-iAyFgw irwSQk" + > + 0 + + XEC + </h3> <div className="sc-jKJlTe hccxef" > = at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:54:18) at Object.asyncJestTest (/work/web/cashtab/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:106:37) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:45:12 at new Promise (<anonymous>) at mapper (/work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:28:19) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:75:41 at processTicksAndRejections (node:internal/process/task_queues:94:5) ====== CashTab Unit Tests: Wallet with BCH balances ====== Error: expect(received).toMatchSnapshot() Snapshot name: `Wallet with BCH balances 1` - Snapshot - 0 + Received + 7 @@ -319,10 +319,17 @@ </div> </div> </div> </div> </div> + <h3 + className="sc-iAyFgw irwSQk" + > + 0 + + XEC + </h3> <div className="sc-jKJlTe hccxef" > = at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:68:18) at Object.asyncJestTest (/work/web/cashtab/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:106:37) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:45:12 at new Promise (<anonymous>) at mapper (/work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:28:19) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:75:41 at processTicksAndRejections (node:internal/process/task_queues:94:5) ====== CashTab Unit Tests: Wallet with BCH balances and tokens ====== Error: expect(received).toMatchSnapshot() Snapshot name: `Wallet with BCH balances and tokens 1` - Snapshot - 0 + Received + 7 @@ -319,10 +319,17 @@ </div> </div> </div> </div> </div> + <h3 + className="sc-iAyFgw irwSQk" + > + 0 + + XEC + </h3> <div className="sc-jKJlTe hccxef" > = at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:82:18) at Object.asyncJestTest (/work/web/cashtab/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:106:37) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:45:12 at new Promise (<anonymous>) at mapper (/work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:28:19) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:75:41 at processTicksAndRejections (node:internal/process/task_queues:94:5) ====== CashTab Unit Tests: Wallet with BCH balances and tokens and state field ====== Error: expect(received).toMatchSnapshot() Snapshot name: `Wallet with BCH balances and tokens and state field 1` - Snapshot - 0 + Received + 7 @@ -326,10 +326,17 @@ </div> </div> </div> </div> </div> + <h3 + className="sc-iAyFgw irwSQk" + > + 0 + + XEC + </h3> <div className="sc-jKJlTe hccxef" > = at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:96:18) at Object.asyncJestTest (/work/web/cashtab/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:106:37) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:45:12 at new Promise (<anonymous>) at mapper (/work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:28:19) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:75:41 at processTicksAndRejections (node:internal/process/task_queues:94:5) ====== CashTab Unit Tests: Without wallet defined ====== Error: expect(received).toMatchSnapshot() Snapshot name: `Without wallet defined 1` - Snapshot - 0 + Received + 7 @@ -319,10 +319,17 @@ </div> </div> </div> </div> </div> + <h3 + className="sc-iAyFgw irwSQk" + > + 0 + + XEC + </h3> <div className="sc-jKJlTe hccxef" > = at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:114:18) at Object.asyncJestTest (/work/web/cashtab/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:106:37) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:45:12 at new Promise (<anonymous>) at mapper (/work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:28:19) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:75:41 at processTicksAndRejections (node:internal/process/task_queues:94:5)
Each failure log is accessible here:
CashTab Unit Tests: Wallet without BCH balance
CashTab Unit Tests: Wallet with BCH balances
CashTab Unit Tests: Wallet with BCH balances and tokens
CashTab Unit Tests: Wallet with BCH balances and tokens and state field
CashTab Unit Tests: Without wallet defined
Pass userLocale to the formatFiatBalance function as well to prevent them from being rendered in different locales.
web/cashtab/src/components/Send/Send.js | ||
---|---|---|
80 ↗ | (On Diff #31672) | This should pull from the master theme object in assets/styles/theme.js |
Added optional userLocale to formatFiatbalance functions throughout, and used styling from master theme.
Failed tests logs:
====== CashTab Unit Tests: Wallet without BCH balance ====== Error: expect(received).toMatchSnapshot() Snapshot name: `Wallet without BCH balance 1` - Snapshot - 1 + Received + 1 @@ -320,11 +320,11 @@ </div> </div> </div> </div> <h3 - className="sc-iAyFgw irwSQk" + className="sc-iAyFgw bGmpty" > 0 XEC </h3> at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:54:18) at Object.asyncJestTest (/work/web/cashtab/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:106:37) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:45:12 at new Promise (<anonymous>) at mapper (/work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:28:19) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:75:41 at processTicksAndRejections (node:internal/process/task_queues:94:5) ====== CashTab Unit Tests: Wallet with BCH balances ====== Error: expect(received).toMatchSnapshot() Snapshot name: `Wallet with BCH balances 1` - Snapshot - 1 + Received + 1 @@ -320,11 +320,11 @@ </div> </div> </div> </div> <h3 - className="sc-iAyFgw irwSQk" + className="sc-iAyFgw bGmpty" > 0 XEC </h3> at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:68:18) at Object.asyncJestTest (/work/web/cashtab/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:106:37) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:45:12 at new Promise (<anonymous>) at mapper (/work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:28:19) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:75:41 at processTicksAndRejections (node:internal/process/task_queues:94:5) ====== CashTab Unit Tests: Wallet with BCH balances and tokens ====== Error: expect(received).toMatchSnapshot() Snapshot name: `Wallet with BCH balances and tokens 1` - Snapshot - 1 + Received + 1 @@ -320,11 +320,11 @@ </div> </div> </div> </div> <h3 - className="sc-iAyFgw irwSQk" + className="sc-iAyFgw bGmpty" > 0 XEC </h3> at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:82:18) at Object.asyncJestTest (/work/web/cashtab/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:106:37) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:45:12 at new Promise (<anonymous>) at mapper (/work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:28:19) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:75:41 at processTicksAndRejections (node:internal/process/task_queues:94:5) ====== CashTab Unit Tests: Wallet with BCH balances and tokens and state field ====== Error: expect(received).toMatchSnapshot() Snapshot name: `Wallet with BCH balances and tokens and state field 1` - Snapshot - 1 + Received + 1 @@ -327,11 +327,11 @@ </div> </div> </div> </div> <h3 - className="sc-iAyFgw irwSQk" + className="sc-iAyFgw bGmpty" > 0 XEC </h3> at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:96:18) at Object.asyncJestTest (/work/web/cashtab/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:106:37) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:45:12 at new Promise (<anonymous>) at mapper (/work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:28:19) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:75:41 at processTicksAndRejections (node:internal/process/task_queues:94:5) ====== CashTab Unit Tests: Without wallet defined ====== Error: expect(received).toMatchSnapshot() Snapshot name: `Without wallet defined 1` - Snapshot - 1 + Received + 1 @@ -320,11 +320,11 @@ </div> </div> </div> </div> <h3 - className="sc-iAyFgw irwSQk" + className="sc-iAyFgw bGmpty" > 0 XEC </h3> at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:114:18) at Object.asyncJestTest (/work/web/cashtab/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:106:37) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:45:12 at new Promise (<anonymous>) at mapper (/work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:28:19) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:75:41 at processTicksAndRejections (node:internal/process/task_queues:94:5)
Each failure log is accessible here:
CashTab Unit Tests: Wallet without BCH balance
CashTab Unit Tests: Wallet with BCH balances
CashTab Unit Tests: Wallet with BCH balances and tokens
CashTab Unit Tests: Wallet with BCH balances and tokens and state field
CashTab Unit Tests: Without wallet defined