Page MenuHomePhabricator

[Cashtab] Remove unused imports from Send.js
ClosedPublic

Authored by kieran709 on Dec 8 2021, 16:41.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABC42a519e6e31d: [Cashtab] Remove unused imports from Send.js
Summary

Removed unused imports from Send.js. Related to task T2071

Test Plan

Navigate to Send.js
Ensure the following imports are removed:
Components:
StyledCollapse
WalletLabel
Wallet

From antd:
notification
paragraph

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Failed tests logs:

====== CashTab Unit Tests:  Wallet without BCH balance ======
Error: expect(received).toMatchSnapshot()

Snapshot name: `Wallet without BCH balance 1`

- Snapshot  - 2
+ Received  + 2

@@ -30,11 +30,11 @@
            className="ant-btn ant-btn-text ant-btn-block"
            onClick={[Function]}
            type="button"
          >
            <div
-             className="sc-uJMKN kqcgKC"
+             className="sc-kEYyzF jiDMYj"
            >
              Switch to multiple recipients
            </div>
          </button>
          <div
@@ -394,11 +394,11 @@
          </div>
        </form>
      </div>
    </div>,
    <div
-     className="sc-dNLxif cAbBwF"
+     className="sc-eNQAEJ fJrcEs"
    >
      Signatures
    </div>,
    <div
      className="ant-collapse ant-collapse-icon-position-left sc-fjdhpX ddFLEP"
    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  - 2
+ Received  + 2

@@ -30,11 +30,11 @@
            className="ant-btn ant-btn-text ant-btn-block"
            onClick={[Function]}
            type="button"
          >
            <div
-             className="sc-uJMKN kqcgKC"
+             className="sc-kEYyzF jiDMYj"
            >
              Switch to multiple recipients
            </div>
          </button>
          <div
@@ -394,11 +394,11 @@
          </div>
        </form>
      </div>
    </div>,
    <div
-     className="sc-dNLxif cAbBwF"
+     className="sc-eNQAEJ fJrcEs"
    >
      Signatures
    </div>,
    <div
      className="ant-collapse ant-collapse-icon-position-left sc-fjdhpX ddFLEP"
    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  - 2
+ Received  + 2

@@ -30,11 +30,11 @@
            className="ant-btn ant-btn-text ant-btn-block"
            onClick={[Function]}
            type="button"
          >
            <div
-             className="sc-uJMKN kqcgKC"
+             className="sc-kEYyzF jiDMYj"
            >
              Switch to multiple recipients
            </div>
          </button>
          <div
@@ -394,11 +394,11 @@
          </div>
        </form>
      </div>
    </div>,
    <div
-     className="sc-dNLxif cAbBwF"
+     className="sc-eNQAEJ fJrcEs"
    >
      Signatures
    </div>,
    <div
      className="ant-collapse ant-collapse-icon-position-left sc-fjdhpX ddFLEP"
    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  - 2
+ Received  + 2

@@ -37,11 +37,11 @@
            className="ant-btn ant-btn-text ant-btn-block"
            onClick={[Function]}
            type="button"
          >
            <div
-             className="sc-uJMKN kqcgKC"
+             className="sc-kEYyzF jiDMYj"
            >
              Switch to multiple recipients
            </div>
          </button>
          <div
@@ -402,11 +402,11 @@
          </div>
        </form>
      </div>
    </div>,
    <div
-     className="sc-dNLxif cAbBwF"
+     className="sc-eNQAEJ fJrcEs"
    >
      Signatures
    </div>,
    <div
      className="ant-collapse ant-collapse-icon-position-left sc-fjdhpX ddFLEP"
    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  - 2
+ Received  + 2

@@ -30,11 +30,11 @@
            className="ant-btn ant-btn-text ant-btn-block"
            onClick={[Function]}
            type="button"
          >
            <div
-             className="sc-uJMKN kqcgKC"
+             className="sc-kEYyzF jiDMYj"
            >
              Switch to multiple recipients
            </div>
          </button>
          <div
@@ -394,11 +394,11 @@
          </div>
        </form>
      </div>
    </div>,
    <div
-     className="sc-dNLxif cAbBwF"
+     className="sc-eNQAEJ fJrcEs"
    >
      Signatures
    </div>,
    <div
      className="ant-collapse ant-collapse-icon-position-left sc-fjdhpX ddFLEP"
    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

1st level review is green.
It's worth creating a separate task to check whether these components are used elsewhere throughout the web/ codebase. If not, remove their source from the codebase entirely and do an end to end regression test (send XEC/eToken, create eToken, switch wallets...etc).

This revision is now accepted and ready to land.Dec 13 2021, 19:33