Page MenuHomePhabricator

[Cashtab] Patch test expectation format issue
AbandonedPublicDraft

Authored by bytesofman on Aug 9 2025, 03:04.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

TBD

Test Plan

TBD

Diff Detail

Repository
rABC Bitcoin ABC
Branch
test-expectation-test
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 34081
Build 67631: Build Diffcashtab-tests
Build 67630: arc lint + arc unit

Event Timeline

Failed tests logs:

====== CashTab Unit Tests: <Tx /> Valid XECX tx ======
TestingLibraryElementError: Unable to find an element with the text: Dec 27, 2024, 00:00:01. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="sc-bdVaJa ShrHD"
    >
      <div
        class="sc-bwzfXH evareY"
      >
        <div
          class="sc-htpNat dEDVDz"
          type="Received"
        >
          <div
            class="sc-bxivhb dMJlQt"
          >
            <div
              class="sc-ifAKCX HhOUq"
            >
              <svg
                title="tx-received"
              />
            </div>
            <div
              class="sc-bZQynM kiCqZV"
            >
              <div
                class="sc-htoDjs drvYtW"
              >
                <div
                  class="sc-gzVnrw icItGV"
                >
                  Received
                   from
                  <a
                    class="sc-kpOJdX iSTZMI"
                    href="https://explorer.e.cash/address/ecash:qqfzls0nhjf7ukgpsmtlly2s2dueq54c5ulydy0h79"
                    rel="noreferrer"
                    target="_blank"
                  >
                    qqf...h79
                  </a>
                </div>
              </div>
              <div
                class="sc-dnqmqq kAjrwE"
              >
                Dec 27, 2024, 24:00:01
                <div
                  class="sc-iwsKbI edyYwf"
                >
                  |
                </div>
                <div
                  class="sc-gZMcBi gBBKsJ"
                  title="Loading"
                >
                  Finalizing
                  <span>
                    .
                  </span>
                  <span>
                    .
                  </span>
                  <span>
                    .
                  </span>
                </div>
              </div>
            </div>
          </div>
          <div
            class="sc-gqjmRU kigJvG"
          >
            <div
              class="sc-VigVT kRalUH"
            >
              <div>
                312.5k
                 
                XEC
              </div>
            </div>
            <div
              class="sc-jTzLTM hCFtvJ"
            >
              $
              9.38
            </div>
          </div>
        </div>
        <div
          class="sc-dxgOiQ bMuCJL"
        >
          <div
            class="sc-eNQAEJ kPJhwa"
          >
            <img
              alt="XECX reward"
              src="test-file-stub"
            />
            <div
              class="sc-ckVGcZ jVmYLB"
            >
              XEC staking reward to all XECX holders with balance
               
              &gt;= 34,580.56 XECX
            </div>
          </div>
        </div>
      </div>
      <div
        class="sc-cSHVUG guTZbU"
      >
        <div
          class="sc-kAzzGY dWgEOn"
        >
          <div
            class="sc-kjoXOD kaHZpU"
          >
            <button
              class="sc-chPdSV fCIcLj"
            >
              <svg
                title="copy-paste"
              />
            </button>
          </div>
          <a
            class="sc-kgoBCf gJDiEd"
            href="https://explorer.e.cash/tx/ca7057d9d878e17d105a732d723c84e10156c61627c9e4330e15a0dfe5ab37a5"
            rel="noreferrer"
            target="_blank"
          >
            <svg
              class="sc-iRbamj iBnhYh"
            />
          </a>
          <a
            class="sc-kgoBCf gJDiEd"
            href="https://blockchair.com/ecash/transaction/ca7057d9d878e17d105a732d723c84e10156c61627c9e4330e15a0dfe5ab37a5.pdf"
            rel="noreferrer"
            target="_blank"
          >
            <svg
              class="sc-jlyJG eMngUa"
            />
          </a>
          <button
            class="sc-chPdSV fCIcLj"
          >
            <svg
              title="add-contact"
            />
          </button>
        </div>
      </div>
    </div>
    ,
  </div>
</body>
    at Object.getElementError (/work/cashtab/node_modules/@testing-library/dom/dist/config.js:37:19)
    at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:76:38
    at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:52:17
    at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:95:19
    at Object.getByText (/work/cashtab/src/components/Home/Tx/__tests__/index.test.js:3787:23)
    at Promise.then.completed (/work/cashtab/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/work/cashtab/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (/work/cashtab/node_modules/jest-circus/build/run.js:316:40)
    at _runTest (/work/cashtab/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (/work/cashtab/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (/work/cashtab/node_modules/jest-circus/build/run.js:121:9)
    at run (/work/cashtab/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (/work/cashtab/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/work/cashtab/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/work/cashtab/node_modules/jest-runner/build/testWorker.js:106:12)
====== CashTab Unit Tests: <Tx /> Invalid XECX tx ======
TestingLibraryElementError: Unable to find an element with the text: Dec 27, 2024, 00:00:01. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="sc-bdVaJa ShrHD"
    >
      <div
        class="sc-bwzfXH evareY"
      >
        <div
          class="sc-htpNat dEDVDz"
          type="Received"
        >
          <div
            class="sc-bxivhb dMJlQt"
          >
            <div
              class="sc-ifAKCX HhOUq"
            >
              <svg
                title="tx-received"
              />
            </div>
            <div
              class="sc-bZQynM kiCqZV"
            >
              <div
                class="sc-htoDjs drvYtW"
              >
                <div
                  class="sc-gzVnrw icItGV"
                >
                  Received
                   from
                  <a
                    class="sc-kpOJdX iSTZMI"
                    href="https://explorer.e.cash/address/ecash:qqfzls0nhjf7ukgpsmtlly2s2dueq54c5ulydy0h79"
                    rel="noreferrer"
                    target="_blank"
                  >
                    qqf...h79
                  </a>
                </div>
              </div>
              <div
                class="sc-dnqmqq kAjrwE"
              >
                Dec 27, 2024, 24:00:01
                <div
                  class="sc-iwsKbI edyYwf"
                >
                  |
                </div>
                <div
                  class="sc-gZMcBi gBBKsJ"
                  title="Loading"
                >
                  Finalizing
                  <span>
                    .
                  </span>
                  <span>
                    .
                  </span>
                  <span>
                    .
                  </span>
                </div>
              </div>
            </div>
          </div>
          <div
            class="sc-gqjmRU kigJvG"
          >
            <div
              class="sc-VigVT kRalUH"
            >
              <div>
                312.5k
                 
                XEC
              </div>
            </div>
            <div
              class="sc-jTzLTM hCFtvJ"
            >
              $
              9.38
            </div>
          </div>
        </div>
        <div
          class="sc-dxgOiQ bMuCJL"
        >
          <div
            class="sc-eNQAEJ kPJhwa"
          >
            <img
              alt="XECX reward"
              src="test-file-stub"
            />
            <div
              class="sc-ckVGcZ kLTRaS"
            >
              Invalid XECX EMPP
            </div>
          </div>
        </div>
      </div>
      <div
        class="sc-cSHVUG guTZbU"
      >
        <div
          class="sc-kAzzGY dWgEOn"
        >
          <div
            class="sc-kjoXOD kaHZpU"
          >
            <button
              class="sc-chPdSV fCIcLj"
            >
              <svg
                title="copy-paste"
              />
            </button>
          </div>
          <a
            class="sc-kgoBCf gJDiEd"
            href="https://explorer.e.cash/tx/ca7057d9d878e17d105a732d723c84e10156c61627c9e4330e15a0dfe5ab37a5"
            rel="noreferrer"
            target="_blank"
          >
            <svg
              class="sc-iRbamj iBnhYh"
            />
          </a>
          <a
            class="sc-kgoBCf gJDiEd"
            href="https://blockchair.com/ecash/transaction/ca7057d9d878e17d105a732d723c84e10156c61627c9e4330e15a0dfe5ab37a5.pdf"
            rel="noreferrer"
            target="_blank"
          >
            <svg
              class="sc-jlyJG eMngUa"
            />
          </a>
          <button
            class="sc-chPdSV fCIcLj"
          >
            <svg
              title="add-contact"
            />
          </button>
        </div>
      </div>
    </div>
    ,
  </div>
</body>
    at Object.getElementError (/work/cashtab/node_modules/@testing-library/dom/dist/config.js:37:19)
    at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:76:38
    at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:52:17
    at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:95:19
    at Object.getByText (/work/cashtab/src/components/Home/Tx/__tests__/index.test.js:3838:23)
    at Promise.then.completed (/work/cashtab/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/work/cashtab/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (/work/cashtab/node_modules/jest-circus/build/run.js:316:40)
    at _runTest (/work/cashtab/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (/work/cashtab/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (/work/cashtab/node_modules/jest-circus/build/run.js:121:9)
    at run (/work/cashtab/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (/work/cashtab/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/work/cashtab/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/work/cashtab/node_modules/jest-runner/build/testWorker.js:106:12)

Each failure log is accessible here:
CashTab Unit Tests: <Tx /> Valid XECX tx
CashTab Unit Tests: <Tx /> Invalid XECX tx

interesting

these

  • pass locally using node v20
  • fail locally using node v22, unless use these changes

why would the node version impact the date formatting? classic JS