First step in task T2348. The headers of the three styled collapses in Send.js should be centered, with the arrow icon staying to the left of the collapse.
Details
- Reviewers
bytesofman - Group Reviewers
Restricted Project - Commits
- rABC530a41fbf048: [Cashtab] Center collapse headers in Send.js
cd web/cashtab && npm start
navigate to the Send page
observe that in each of the 3 styled collapses, the header is centered
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- collapse-styling-sendjs-patch
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 18919 Build 37617: Build Diff cashtab-tests Build 37616: 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 - 3 + Received + 3 @@ -377,11 +377,11 @@ > Send </button> </div> <div - className="sc-bRBYWo kDCtna" + className="sc-bRBYWo fNHvEm" > <div className="ant-collapse ant-collapse-icon-position-left sc-kAzzGY itTQAx" role={null} style={ @@ -433,11 +433,11 @@ </div> </form> </div> </div> <div - className="sc-bRBYWo kDCtna" + className="sc-bRBYWo fNHvEm" > <div className="ant-collapse ant-collapse-icon-position-left sc-kAzzGY itTQAx" role={null} style={ @@ -486,11 +486,11 @@ </div> </div> </div> </div> <div - className="sc-bRBYWo kDCtna" + className="sc-bRBYWo fNHvEm" > <div className="ant-collapse ant-collapse-icon-position-left sc-kAzzGY itTQAx" role={null} style={ at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:46:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12) ====== CashTab Unit Tests: Wallet with BCH balances ====== Error: expect(received).toMatchSnapshot() Snapshot name: `Wallet with BCH balances 1` - Snapshot - 3 + Received + 3 @@ -377,11 +377,11 @@ > Send </button> </div> <div - className="sc-bRBYWo kDCtna" + className="sc-bRBYWo fNHvEm" > <div className="ant-collapse ant-collapse-icon-position-left sc-kAzzGY itTQAx" role={null} style={ @@ -433,11 +433,11 @@ </div> </form> </div> </div> <div - className="sc-bRBYWo kDCtna" + className="sc-bRBYWo fNHvEm" > <div className="ant-collapse ant-collapse-icon-position-left sc-kAzzGY itTQAx" role={null} style={ @@ -486,11 +486,11 @@ </div> </div> </div> </div> <div - className="sc-bRBYWo kDCtna" + className="sc-bRBYWo fNHvEm" > <div className="ant-collapse ant-collapse-icon-position-left sc-kAzzGY itTQAx" role={null} style={ at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:61:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12) ====== CashTab Unit Tests: Wallet with BCH balances and tokens ====== Error: expect(received).toMatchSnapshot() Snapshot name: `Wallet with BCH balances and tokens 1` - Snapshot - 3 + Received + 3 @@ -377,11 +377,11 @@ > Send </button> </div> <div - className="sc-bRBYWo kDCtna" + className="sc-bRBYWo fNHvEm" > <div className="ant-collapse ant-collapse-icon-position-left sc-kAzzGY itTQAx" role={null} style={ @@ -433,11 +433,11 @@ </div> </form> </div> </div> <div - className="sc-bRBYWo kDCtna" + className="sc-bRBYWo fNHvEm" > <div className="ant-collapse ant-collapse-icon-position-left sc-kAzzGY itTQAx" role={null} style={ @@ -486,11 +486,11 @@ </div> </div> </div> </div> <div - className="sc-bRBYWo kDCtna" + className="sc-bRBYWo fNHvEm" > <div className="ant-collapse ant-collapse-icon-position-left sc-kAzzGY itTQAx" role={null} style={ at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:76:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12) ====== 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 - 3 + Received + 3 @@ -377,11 +377,11 @@ > Send </button> </div> <div - className="sc-bRBYWo kDCtna" + className="sc-bRBYWo fNHvEm" > <div className="ant-collapse ant-collapse-icon-position-left sc-kAzzGY itTQAx" role={null} style={ @@ -433,11 +433,11 @@ </div> </form> </div> </div> <div - className="sc-bRBYWo kDCtna" + className="sc-bRBYWo fNHvEm" > <div className="ant-collapse ant-collapse-icon-position-left sc-kAzzGY itTQAx" role={null} style={ @@ -486,11 +486,11 @@ </div> </div> </div> </div> <div - className="sc-bRBYWo kDCtna" + className="sc-bRBYWo fNHvEm" > <div className="ant-collapse ant-collapse-icon-position-left sc-kAzzGY itTQAx" role={null} style={ at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:93:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12) ====== CashTab Unit Tests: Without wallet defined ====== Error: expect(received).toMatchSnapshot() Snapshot name: `Without wallet defined 1` - Snapshot - 3 + Received + 3 @@ -372,11 +372,11 @@ > Send </button> </div> <div - className="sc-bRBYWo kDCtna" + className="sc-bRBYWo fNHvEm" > <div className="ant-collapse ant-collapse-icon-position-left sc-kAzzGY itTQAx" role={null} style={ @@ -428,11 +428,11 @@ </div> </form> </div> </div> <div - className="sc-bRBYWo kDCtna" + className="sc-bRBYWo fNHvEm" > <div className="ant-collapse ant-collapse-icon-position-left sc-kAzzGY itTQAx" role={null} style={ @@ -481,11 +481,11 @@ </div> </div> </div> </div> <div - className="sc-bRBYWo kDCtna" + className="sc-bRBYWo fNHvEm" > <div className="ant-collapse ant-collapse-icon-position-left sc-kAzzGY itTQAx" role={null} style={ at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:113:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12)
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
Since this fix is repeated across multiple components, please define this component in StyledCollapse and export it to Send.
Also, apply this fix to the collapse menu in Airdrop.js.
The custom component should look something like
export const CustomCollapseCtn = ({class, key, children}) => { return ( <CollapseCtn> <AdvancedCollapse style={{ marginBottom: '24px', }} > <Panel header={ <div className={class}> Verify Message </div> } key={key} > {children} </CollapseCtn>); };
Responding to review feedback, added CustomCollapseContainer to StyledCollapse, replace the 3 collapses in Send.js and 1 in Airdrop.js with the new component.
web/cashtab/src/components/Common/StyledCollapse.js | ||
---|---|---|
113 ↗ | (On Diff #33114) | See T2382 These components do not need the key parameter. It's okay to just drop it here. |
138 ↗ | (On Diff #33114) | remove key |
web/cashtab/src/components/Send/Send.js | ||
961 ↗ | (On Diff #33114) | What's the purpose of this className? |
1081 ↗ | (On Diff #33114) | What's the purpose of this className? |
1172 ↗ | (On Diff #33114) | What's the purpose of this className? |
Having spent more time with this, I am fairly confident that the options are to:
A. use a className to keep the arrow icon on the left of the collapse and move the Panel Header to the center or
B. Center the Panel Header and the arrow icon
As far as I can tell, there is no way to select just the text without using some kind of selector, whether it is a className or an element . Let me know how you would like me to proceed!
web/cashtab/src/components/Airdrop/Airdrop.js | ||
---|---|---|
526 ↗ | (On Diff #33122) | Remove leading space |
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 @@ -74,11 +74,11 @@ </span> </div> <div className="centeredTitleCollapse" > - XEC Airdrop Calculator + XEC Airdrop Calculator </div> </div> </div> </div> </div> at Object.<anonymous> (/work/web/cashtab/src/components/Airdrop/__tests__/Airdrop.test.js:46:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12) ====== CashTab Unit Tests: Wallet with BCH balances ====== Error: expect(received).toMatchSnapshot() Snapshot name: `Wallet with BCH balances 1` - Snapshot - 1 + Received + 1 @@ -74,11 +74,11 @@ </span> </div> <div className="centeredTitleCollapse" > - XEC Airdrop Calculator + XEC Airdrop Calculator </div> </div> </div> </div> </div> at Object.<anonymous> (/work/web/cashtab/src/components/Airdrop/__tests__/Airdrop.test.js:61:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12) ====== 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 @@ -74,11 +74,11 @@ </span> </div> <div className="centeredTitleCollapse" > - XEC Airdrop Calculator + XEC Airdrop Calculator </div> </div> </div> </div> </div> at Object.<anonymous> (/work/web/cashtab/src/components/Airdrop/__tests__/Airdrop.test.js:76:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12) ====== 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 @@ -73,11 +73,11 @@ </span> </div> <div className="centeredTitleCollapse" > - XEC Airdrop Calculator + XEC Airdrop Calculator </div> </div> </div> </div> </div> at Object.<anonymous> (/work/web/cashtab/src/components/Airdrop/__tests__/Airdrop.test.js:93:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12) ====== CashTab Unit Tests: Without wallet defined ====== Error: expect(received).toMatchSnapshot() Snapshot name: `Without wallet defined 1` - Snapshot - 1 + Received + 1 @@ -69,11 +69,11 @@ </span> </div> <div className="centeredTitleCollapse" > - XEC Airdrop Calculator + XEC Airdrop Calculator </div> </div> </div> </div> </div> at Object.<anonymous> (/work/web/cashtab/src/components/Airdrop/__tests__/Airdrop.test.js:113:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12)
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
web/cashtab/src/components/Airdrop/Airdrop.js | ||
---|---|---|
526 ↗ | (On Diff #33317) | does this still match previous functionality without the defaultActiveKey param? Please include this param. Need to pass it down to the AdvancedCollapse child component in CustomCollapseContainer |
web/cashtab/src/components/Send/Send.js | ||
967 ↗ | (On Diff #33317) | does this still match previous functionality without the defaultActiveKey param? Please include this param. Need to pass it down to the AdvancedCollapse child component in CustomCollapseContainer |
web/cashtab/src/components/Common/StyledCollapse.js | ||
---|---|---|
128 ↗ | (On Diff #33344) | Use a styled component for this div instead of className |
142 ↗ | (On Diff #33344) | Looks like options are ['0'] or ['1'] From antd, https://ant.design/components/collapse/ Types are either array of string or array of number Since we are using the string here, can just list that. PropTypes.arrayOf(PropTypes.string) see https://reactjs.org/docs/typechecking-with-proptypes.html |
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 @@ -72,11 +72,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > XEC Airdrop Calculator </div> </div> </div> at Object.<anonymous> (/work/web/cashtab/src/components/Airdrop/__tests__/Airdrop.test.js:46:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12)Error: expect(received).toMatchSnapshot() Snapshot name: `Wallet without BCH balance 1` - Snapshot - 3 + Received + 3 @@ -421,11 +421,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > Advanced </div> </div> </div> @@ -477,11 +477,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > Sign Message </div> </div> </div> @@ -530,11 +530,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > Verify Message </div> </div> </div> at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:46:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12) ====== CashTab Unit Tests: Wallet with BCH balances ====== Error: expect(received).toMatchSnapshot() Snapshot name: `Wallet with BCH balances 1` - Snapshot - 1 + Received + 1 @@ -72,11 +72,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > XEC Airdrop Calculator </div> </div> </div> at Object.<anonymous> (/work/web/cashtab/src/components/Airdrop/__tests__/Airdrop.test.js:61:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12)Error: expect(received).toMatchSnapshot() Snapshot name: `Wallet with BCH balances 1` - Snapshot - 3 + Received + 3 @@ -421,11 +421,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > Advanced </div> </div> </div> @@ -477,11 +477,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > Sign Message </div> </div> </div> @@ -530,11 +530,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > Verify Message </div> </div> </div> at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:61:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12) ====== 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 @@ -72,11 +72,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > XEC Airdrop Calculator </div> </div> </div> at Object.<anonymous> (/work/web/cashtab/src/components/Airdrop/__tests__/Airdrop.test.js:76:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12)Error: expect(received).toMatchSnapshot() Snapshot name: `Wallet with BCH balances and tokens 1` - Snapshot - 3 + Received + 3 @@ -421,11 +421,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > Advanced </div> </div> </div> @@ -477,11 +477,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > Sign Message </div> </div> </div> @@ -530,11 +530,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > Verify Message </div> </div> </div> at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:76:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12) ====== 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 @@ -71,11 +71,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > XEC Airdrop Calculator </div> </div> </div> at Object.<anonymous> (/work/web/cashtab/src/components/Airdrop/__tests__/Airdrop.test.js:93:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12)Error: expect(received).toMatchSnapshot() Snapshot name: `Wallet with BCH balances and tokens and state field 1` - Snapshot - 3 + Received + 3 @@ -421,11 +421,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > Advanced </div> </div> </div> @@ -477,11 +477,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > Sign Message </div> </div> </div> @@ -530,11 +530,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > Verify Message </div> </div> </div> at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:93:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12) ====== CashTab Unit Tests: Without wallet defined ====== Error: expect(received).toMatchSnapshot() Snapshot name: `Without wallet defined 1` - Snapshot - 1 + Received + 1 @@ -67,11 +67,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > XEC Airdrop Calculator </div> </div> </div> at Object.<anonymous> (/work/web/cashtab/src/components/Airdrop/__tests__/Airdrop.test.js:113:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12)Error: expect(received).toMatchSnapshot() Snapshot name: `Without wallet defined 1` - Snapshot - 3 + Received + 3 @@ -416,11 +416,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > Advanced </div> </div> </div> @@ -472,11 +472,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > Sign Message </div> </div> </div> @@ -525,11 +525,11 @@ /> </svg> </span> </div> <div - className="sc-chPdSV AGhxe" + className="sc-chPdSV byfFmt" > Verify Message </div> </div> </div> at Object.<anonymous> (/work/web/cashtab/src/components/Send/__tests__/Send.test.js:113:18) at Promise.then.completed (/work/web/cashtab/node_modules/jest-circus/build/utils.js:391:28) at new Promise (<anonymous>) at callAsyncCircusFn (/work/web/cashtab/node_modules/jest-circus/build/utils.js:316:10) at _callCircusTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:218:40) at processTicksAndRejections (node:internal/process/task_queues:94:5) at _runTest (/work/web/cashtab/node_modules/jest-circus/build/run.js:155:3) at _runTestsForDescribeBlock (/work/web/cashtab/node_modules/jest-circus/build/run.js:66:9) at run (/work/web/cashtab/node_modules/jest-circus/build/run.js:25:3) at runAndTransformResultsToJestFormat (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21) at jestAdapter (/work/web/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19) at runTestInternal (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:389:16) at runTest (/work/web/cashtab/node_modules/jest-runner/build/runTest.js:475:34) at Object.worker (/work/web/cashtab/node_modules/jest-runner/build/testWorker.js:133:12)
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