Page MenuHomePhabricator

[Cashtab] Change default setting for camera auto-open
ClosedPublic

Authored by bytesofman on Sun, Jan 26, 08:18.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABC52a98f0e8ff5: [Cashtab] Change default setting for camera auto-open
Summary

In practice I don't think this is a popular feature. More likely to confuse user than streamline sendign to QR codes.

But, for users who do want to streamline sending to QR codes, they can enable it.

Test Plan

npm test

Diff Detail

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

Event Timeline

Failed tests logs:

====== CashTab Unit Tests: Cashtab validation functions Appropriately migrates users with legacy settings migrateLegacyCashtabSettings: User with only fiatCurrency in settings ======
Error: expect(received).toEqual(expected) // deep equality

- Expected  - 1
+ Received  + 1

@@ -1,7 +1,7 @@
  Object {
-   "autoCameraOn": true,
+   "autoCameraOn": false,
    "balanceVisible": true,
    "fiatCurrency": "gbp",
    "hideMessagesFromUnknownSenders": false,
    "minFeeSends": false,
    "sendModal": false,
    at Object.toEqual (/work/cashtab/src/validation/__tests__/index.test.js:347:70)
    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 processTicksAndRejections (node:internal/process/task_queues:95:5)
    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 _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: <Token /> available actions rendered We can list an SLP1 fungible token ======
TestingLibraryElementError: Unable to find an accessible element with the role "button" and name `/List Vespene Gas/`

Here are the accessible roles:

  region:

  Name "Notifications Alt+T":
  <section
    aria-atomic="false"
    aria-label="Notifications Alt+T"
    aria-live="polite"
    aria-relevant="additions text"
    class="Toastify"
  />

  --------------------------------------------------
  combobox:

  Name "":
  <select
    class="sc-jkCMRl elqxlt"
    data-testid="wallet-select"
    id="wallets"
    name="wallets"
  />

  --------------------------------------------------
  option:

  Name "Token Test":
  <option
    class="sc-crNyjn fdrrlO"
    value="Token Test"
  />

  --------------------------------------------------
  button:

  Name "Copy ecash:qqq9f9z3uhpzkxrgdjkd7dxuuey7tmpmugpmnw0kue":
  <button
    aria-label="Copy ecash:qqq9f9z3uhpzkxrgdjkd7dxuuey7tmpmugpmnw0kue"
    class="sc-cJSrbW kZNvLw"
  />

  Name "icon for 20a0b9337a78603c6681ed2bc541593375535dcd9979196620ce71f233f2f6f8":
  <button
    class="sc-iBEsjs jWuvKl"
  />

  Name "Click for more info about this token type":
  <button
    aria-label="Click for more info about this token type"
    class="sc-cJSrbW kZNvLw"
  />

  Name "Copy Token ID":
  <button
    aria-label="Copy Token ID"
    class="sc-cJSrbW kZNvLw"
  />

  Name "Click for more info about agora partial sales":
  <button
    aria-label="Click for more info about agora partial sales"
    class="sc-cJSrbW kZNvLw"
  />

  Name "Transactions":
  <button
    class="sc-jvEmr hqZIZM"
  />

  Name "Send Screen":
  <button
    aria-label="Send Screen"
    class="sc-jvEmr hqZIZM"
  />

  Name "Tokens":
  <button
    aria-label="Tokens"
    class="sc-jvEmr hqZIZM"
  />

  Name "Receive":
  <button
    aria-label="Receive"
    class="sc-jvEmr hqZIZM"
  />

  Name "Wallet Backup":
  <button
    class="sc-hycgNl bNyILw"
  />

  Name "Wallets":
  <button
    class="sc-hycgNl bNyILw"
  />

  Name "Listed NFTs":
  <button
    class="sc-hycgNl bNyILw"
  />

  Name "Agora":
  <button
    class="sc-hycgNl bNyILw"
  />

  Name "Contacts":
  <button
    class="sc-hycgNl bNyILw"
  />

  Name "Airdrop":
  <button
    class="sc-hycgNl bNyILw"
  />

  Name "Rewards":
  <button
    class="sc-hycgNl bNyILw"
  />

  Name "Sign & Verify":
  <button
    class="sc-hycgNl bNyILw"
  />

  Name "Settings":
  <button
    class="sc-hycgNl bNyILw"
  />

  --------------------------------------------------
  paragraph:

  Name "Price in Local Currency":
  <p
    class="sc-bhlBdH umymk"
    title="Price in Local Currency"
  />

  Name "":
  <p />

  Name "":
  <p />

  Name "":
  <p />

  Name "":
  <p />

  Name "":
  <p />

  Name "":
  <p />

  Name "":
  <p />

  Name "":
  <p />

  Name "":
  <p />

  --------------------------------------------------
  img:

  Name "icon for 20a0b9337a78603c6681ed2bc541593375535dcd9979196620ce71f233f2f6f8":
  <img
    alt="icon for 20a0b9337a78603c6681ed2bc541593375535dcd9979196620ce71f233f2f6f8"
    height="128"
    src="https://icons.etokens.cash/128/20a0b9337a78603c6681ed2bc541593375535dcd9979196620ce71f233f2f6f8.png"
    width="128"
  />

  Name "cashtab":
  <img
    alt="cashtab"
    class="sc-ivVeuv evHkvQ"
    src="test-file-stub"
  />

  --------------------------------------------------
  heading:

  Name "Vespene Gas":
  <h2 />

  --------------------------------------------------
  link:

  Name "20a...6f8":
  <a
    href="https://explorer.e.cash/tx/20a0b9337a78603c6681ed2bc541593375535dcd9979196620ce71f233f2f6f8"
    rel="noopener noreferrer"
    target="_blank"
  />

  Name "simple.wikipedia.org/wiki/StarCraft#Gameplay":
  <a
    href="https://simple.wikipedia.org/wiki/StarCraft#Gameplay"
    rel="noreferrer"
    target="_blank"
  />

  --------------------------------------------------

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="sc-AnqlK jzmxJP"
    >
      <section
        aria-atomic="false"
        aria-label="Notifications Alt+T"
        aria-live="polite"
        aria-relevant="additions text"
        class="Toastify"
      />
      <div
        class="sc-keFjpB kpRoMq"
      >
        <div
          class="sc-jWojfa dWofVP"
        >
          <div
            class="sc-dTLGrV hVKRQa"
          >
            <img
              alt="cashtab"
              class="sc-ivVeuv evHkvQ"
              src="test-file-stub"
            />
          </div>
          <div
            class="sc-hdPSEv NMixZ"
          >
            <div
              class="sc-bqjOQT bJwGKq"
            >
              <select
                class="sc-jkCMRl elqxlt"
                data-testid="wallet-select"
                id="wallets"
                name="wallets"
              >
                <option
                  class="sc-crNyjn fdrrlO"
                  value="Token Test"
                >
                  Token Test
                </option>
              </select>
              <div
                class="sc-lcpuFF iSIgFF"
              >
                <button
                  aria-label="Copy ecash:qqq9f9z3uhpzkxrgdjkd7dxuuey7tmpmugpmnw0kue"
                  class="sc-cJSrbW kZNvLw"
                >
                  <svg
                    title="copy-paste"
                  />
                </button>
                <div
                  class="sc-eerKOB cvXwwv"
                >
                  <div
                    class="sc-emmjRN bSWkUh"
                  >
                    <input
                      checked=""
                      class="sc-gFaPwZ iPJMNd"
                      id="show-hide-balance"
                      name="show-hide-balance"
                      title="show-hide-balance"
                      type="checkbox"
                    />
                    <label
                      class="sc-cpmLhU iUeRKn"
                      for="show-hide-balance"
                    >
                      <span
                        class="sc-dymIpo hGwQkt"
                        data-off=""
                        data-on=""
                      />
                      <span
                        class="sc-bnXvFD cpOMDW"
                      />
                    </label>
                  </div>
                </div>
              </div>
            </div>
            <div
              class="sc-cmIlrE dkSzlg"
              title="Wallet Info"
            >
              <div
                class="sc-cpHetk jEKVml"
              >
                <div
                  class="sc-nrwXf bsChRe"
                  title="Balance XEC"
                >
                  9,970.81
                   
                  XEC
                </div>
              </div>
              <div
                class="sc-eitiEO lmPAIm"
                title="Balance in Local Currency"
              >
                $
                0.30
                 
                USD
              </div>
              <p
                class="sc-bhlBdH umymk"
                title="Price in Local Currency"
              >
                1 
                XEC
                 = 
                0.00003000
                 
                USD
              </p>
            </div>
          </div>
          <div
            class="sc-chAAoq bzVCQv"
          >
            <div
              class="sc-ebFjAB gdAnYe"
            >
              <div
                class="sc-cooIXK egNoCH"
                title="Token Stats"
              >
                <div
                  class="sc-kZmsYB KVWTe"
                >
                  <button
                    class="sc-iBEsjs jWuvKl"
                  >
                    <img
                      alt="icon for 20a0b9337a78603c6681ed2bc541593375535dcd9979196620ce71f233f2f6f8"
                      height="128"
                      src="https://icons.etokens.cash/128/20a0b9337a78603c6681ed2bc541593375535dcd9979196620ce71f233f2f6f8.png"
                      width="128"
                    />
                  </button>
                  <h2>
                    Vespene Gas
                  </h2>
                  <span>
                    VSP
                  </span>
                </div>
                <div
                  class="sc-fcdeBU kmDggL"
                >
                  <div
                    class="sc-iSDuPN iBWdux"
                  >
                    <label>
                      Your Balance
                    </label>
                    <div>
                      111.000000000
                       VSP
                    </div>
                  </div>
                  <div
                    class="sc-iSDuPN eDnwXA"
                  >
                    <label>
                      Type
                    </label>
                    <div>
                      <div
                        class="sc-LKuAh jgyJGf"
                      >
                        SLP
                         
                        <button
                          aria-label="Click for more info about this token type"
                          class="sc-cJSrbW kZNvLw"
                        >
                          <svg
                            title="More Info"
                          />
                        </button>
                      </div>
                    </div>
                  </div>
                  <div
                    class="sc-iSDuPN eDnwXA"
                  >
                    <label>
                      Token Id
                    </label>
                    <div>
                      <a
                        href="https://explorer.e.cash/tx/20a0b9337a78603c6681ed2bc541593375535dcd9979196620ce71f233f2f6f8"
                        rel="noopener noreferrer"
                        target="_blank"
                      >
                        20a
                        ...
                        6f8
                      </a>
                      <button
                        aria-label="Copy Token ID"
                        class="sc-cJSrbW kZNvLw"
                      >
                        <svg
                          title="copy-paste"
                        />
                      </button>
                    </div>
                  </div>
                  <div
                    class="sc-iSDuPN eDnwXA"
                  >
                    <label>
                      Decimals
                    </label>
                    <div>
                      9
                    </div>
                  </div>
                  <div
                    class="sc-iSDuPN eDnwXA"
                  >
                    <label>
                      URL
                    </label>
                    <div
                      class="sc-kZmsYB sc-RcBXQ dyDgLR"
                    >
                      <a
                        href="https://simple.wikipedia.org/wiki/StarCraft#Gameplay"
                        rel="noreferrer"
                        target="_blank"
                      >
                        simple.wikipedia.org/wiki/StarCraft#Gameplay
                      </a>
                    </div>
                  </div>
                  <div
                    class="sc-iSDuPN eDnwXA"
                  >
                    <label>
                      Created
                    </label>
                    <div>
                      Jan 1, 2022
                    </div>
                  </div>
                  <div
                    class="sc-iSDuPN eDnwXA"
                  >
                    <label>
                      Genesis Qty
                    </label>
                    <div>
                      3,000,000,000.000000000
                    </div>
                  </div>
                  <div
                    class="sc-iSDuPN eDnwXA"
                  >
                    <label>
                      Supply
                    </label>
                    <div>
                      <div
                        class="sc-jzJRlG eQTBdJ"
                        title="Loading"
                      >
                        <div />
                        <div />
                        <div />
                        <div />
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div
                class="sc-hzNEM kMIGYt"
                title="Token Actions"
              >
                <div
                  class="sc-fQejPQ kELCPK"
                >
                  <div
                    class="sc-eerKOB cvXwwv"
                  >
                    <div
                      class="sc-emmjRN iogvmX"
                    >
                      <input
                        class="sc-gFaPwZ iPJMNd"
                        id="Toggle Sell Token"
                        name="Toggle Sell Token"
                        title="Toggle Sell Token"
                        type="checkbox"
                      />
                      <label
                        class="sc-cpmLhU iUeRKn"
                        for="Toggle Sell Token"
                      >
                        <span
                          class="sc-dymIpo ebJcUo"
                          data-off="💰"
                          data-on="💰"
                        />
                        <span
                          class="sc-bnXvFD bEXILN"
                        />
                      </label>
                    </div>
                  </div>
                  <div
                    class="sc-jqCOkK sCOdD"
                  >
                    Sell 
                    Vespene Gas
                     (
                    VSP
                    )
                  </div>
                  <button
                    aria-label="Click for more info about agora partial sales"
                    class="sc-cJSrbW kZNvLw"
                  >
                    <svg
                      title="More Info"
                    />
                  </button>
                </div>
                <div
                  class="sc-fQejPQ kELCPK"
                >
                  <div
                    class="sc-eerKOB cvXwwv"
                  >
                    <div
                      class="sc-emmjRN iogvmX"
                    >
                      <input
                        class="sc-gFaPwZ iPJMNd"
                        id="Toggle Send"
                        name="Toggle Send"
                        title="Toggle Send"
                        type="checkbox"
                      />
                      <label
                        class="sc-cpmLhU iUeRKn"
                        for="Toggle Send"
                      >
                        <span
                          class="sc-dymIpo ebJcUo"
                          data-off="➡️"
                          data-on="➡️"
                        />
                        <span
                          class="sc-bnXvFD bEXILN"
                        />
                      </label>
                    </div>
                  </div>
                  <div
                    class="sc-jqCOkK sCOdD"
                  >
                    Send 
                    Vespene Gas
                     (
                    VSP
                    )
                  </div>
                </div>
                <div
                  class="sc-fQejPQ kELCPK"
                >
                  <div
                    class="sc-eerKOB cvXwwv"
                  >
                    <div
                      class="sc-emmjRN iogvmX"
                    >
                      <input
                        class="sc-gFaPwZ iPJMNd"
                        id="Toggle Airdrop"
                        name="Toggle Airdrop"
                        title="Toggle Airdrop"
                        type="checkbox"
                      />
                      <label
                        class="sc-cpmLhU iUeRKn"
                        for="Toggle Airdrop"
                      >
                        <span
                          class="sc-dymIpo ebJcUo"
                          data-off="🪂"
                          data-on="🪂"
                        />
                        <span
                          class="sc-bnXvFD bEXILN"
                        />
                      </label>
                    </div>
                  </div>
                  <div
                    class="sc-jqCOkK sCOdD"
                  >
                    Airdrop XEC to 
                    VSP
                     
                    holders
                  </div>
                </div>
                <div
                  class="sc-fQejPQ kELCPK"
                >
                  <div
                    class="sc-eerKOB cvXwwv"
                  >
                    <div
                      class="sc-emmjRN iogvmX"
                    >
                      <input
                        class="sc-gFaPwZ iPJMNd"
                        id="Toggle Burn"
                        name="Toggle Burn"
                        title="Toggle Burn"
                        type="checkbox"
                      />
                      <label
                        class="sc-cpmLhU iUeRKn"
                        for="Toggle Burn"
                      >
                        <span
                          class="sc-dymIpo ebJcUo"
                          data-off="🔥"
                          data-on="🔥"
                        />
                        <span
                          class="sc-bnXvFD bEXILN"
                        />
                      </label>
                    </div>
                  </div>
                  <div
                    class="sc-jqCOkK sCOdD"
                  >
                    Burn 
                    VSP
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div
          class="sc-kVrTmx exLrES"
        >
          <div
            class="sc-fHSTwm jBcETl"
          >
            <img
              alt="cashtab"
              class="sc-ivVeuv evHkvQ"
              src="test-file-stub"
            />
          </div>
          <button
            class="sc-jvEmr hqZIZM"
          >
            <span>
              Transactions
            </span>
            <svg />
          </button>
          <button
            aria-label="Send Screen"
            class="sc-jvEmr hqZIZM"
          >
            <span>
              Send
            </span>
            <svg
              title="tx-sent"
            />
          </button>
          <button
            aria-label="Tokens"
            class="sc-jvEmr hqZIZM"
          >
            <span>
              Tokens
            </span>
            <svg
              title="Tokens"
            />
          </button>
          <button
            aria-label="Receive"
            class="sc-jvEmr hqZIZM"
          >
            <span>
              Receive
            </span>
            <svg
              title="tx-received"
            />
          </button>
          <div
            class="sc-ekkqgF dcQEnG"
            title="Show Other Screens"
          >
            <span
              class="sc-iBmynh dPVmzy"
            />
            <div
              class="sc-fKGOjr buAdOz"
              title="Other Screens"
            >
              <button
                class="sc-hycgNl bNyILw"
              >
                 
                <p>
                  Wallet Backup
                </p>
                <svg
                  title="wallet"
                />
              </button>
              <button
                class="sc-hycgNl bNyILw"
              >
                 
                <p>
                  Wallets
                </p>
                <svg
                  title="wallets"
                />
              </button>
              <button
                class="sc-hycgNl bNyILw"
              >
                 
                <p>
                  Listed NFTs
                </p>
                <svg
                  title="NFT"
                />
              </button>
              <button
                class="sc-hycgNl bNyILw"
              >
                 
                <p>
                  Agora
                </p>
                <svg
                  title="Meme Agora"
                />
              </button>
              <button
                class="sc-hycgNl bNyILw"
              >
                 
                <p>
                  Contacts
                </p>
                <svg
                  title="Contact List"
                />
              </button>
              <button
                class="sc-hycgNl bNyILw"
              >
                 
                <p>
                  Airdrop
                </p>
                <svg
                  title="tx-airdrop"
                />
              </button>
              <button
                class="sc-hycgNl bNyILw"
              >
                 
                <p>
                  Rewards
                </p>
                <svg
                  title="Cashtab Rewards"
                />
              </button>
              <button
                class="sc-hycgNl bNyILw"
              >
                <p>
                  Sign & Verify
                </p>
                <svg
                  class="sc-htpNat bPFBeM"
                />
              </button>
              <button
                class="sc-hycgNl bNyILw"
              >
                <p>
                  Settings
                </p>
                <svg
                  title="settings"
                />
              </button>
            </div>
          </div>
        </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.getByRole (/work/cashtab/src/components/Etokens/__tests__/TokenActions.test.js:275:35)

Each failure log is accessible here:
CashTab Unit Tests: Cashtab validation functions Appropriately migrates users with legacy settings migrateLegacyCashtabSettings: User with only fiatCurrency in settings
CashTab Unit Tests: <Token /> available actions rendered We can list an SLP1 fungible token

patch test, even if user does have setting enabled do not open Send with the camera if we have a tx

This revision is now accepted and ready to land.Sun, Jan 26, 11:05