diff --git a/cashtab/package-lock.json b/cashtab/package-lock.json --- a/cashtab/package-lock.json +++ b/cashtab/package-lock.json @@ -1,12 +1,12 @@ { "name": "cashtab", - "version": "2.32.3", + "version": "2.32.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cashtab", - "version": "2.32.3", + "version": "2.32.4", "dependencies": { "@bitgo/utxo-lib": "^9.33.0", "@zxing/browser": "^0.1.4", diff --git a/cashtab/package.json b/cashtab/package.json --- a/cashtab/package.json +++ b/cashtab/package.json @@ -1,6 +1,6 @@ { "name": "cashtab", - "version": "2.32.3", + "version": "2.32.4", "private": true, "scripts": { "start": "node scripts/start.js", diff --git a/cashtab/src/components/Etokens/Token.js b/cashtab/src/components/Etokens/Token.js --- a/cashtab/src/components/Etokens/Token.js +++ b/cashtab/src/components/Etokens/Token.js @@ -1063,28 +1063,25 @@ )} - - - // We turn everything else off, whether we are turning this one on or off - setSwitches({ - ...switchesOff, - showMint: !switches.showMint, - }) - } - /> - - Mint - {mintBatons.length === 0 - ? ' (disabled, no mint baton in wallet)' - : ''} - - + {mintBatons.length > 0 && ( + + + // We turn everything else off, whether we are turning this one on or off + setSwitches({ + ...switchesOff, + showMint: + !switches.showMint, + }) + } + /> + Mint + + )} {switches.showMint && ( diff --git a/cashtab/src/components/Etokens/__tests__/Token.test.js b/cashtab/src/components/Etokens/__tests__/Token.test.js --- a/cashtab/src/components/Etokens/__tests__/Token.test.js +++ b/cashtab/src/components/Etokens/__tests__/Token.test.js @@ -514,10 +514,6 @@ 'checked', false, ); - expect(screen.getByTitle('Toggle Mint')).toHaveProperty( - 'checked', - false, - ); await user.type(screen.getByPlaceholderText('Burn Amount'), '1'); @@ -557,15 +553,8 @@ // Wait for element to get token info and load expect((await screen.findAllByText(/BEAR/))[0]).toBeInTheDocument(); - // The mint switch is disabled - expect(screen.getByTitle('Toggle Mint')).toHaveProperty( - 'disabled', - true, - ); - - expect( - screen.getByText(/(disabled, no mint baton in wallet)/), - ).toBeInTheDocument(); + // The mint switch is not rendered + expect(screen.queryByTitle('Toggle Mint')).not.toBeInTheDocument(); }); it('We can mint an slpv1 token if we have a mint baton', async () => { // Mock context with a mint baton utxo @@ -663,9 +652,9 @@ // Wait for element to get token info and load expect((await screen.findAllByText(/CACHET/))[0]).toBeInTheDocument(); - // The mint switch is enabled + // The mint switch is rendered const mintSwitch = screen.getByTitle('Toggle Mint'); - expect(mintSwitch).toHaveProperty('disabled', false); + expect(mintSwitch).toBeInTheDocument(); // Click the mint switch await user.click(mintSwitch); diff --git a/cashtab/src/components/Etokens/__tests__/TokenActions.test.js b/cashtab/src/components/Etokens/__tests__/TokenActions.test.js --- a/cashtab/src/components/Etokens/__tests__/TokenActions.test.js +++ b/cashtab/src/components/Etokens/__tests__/TokenActions.test.js @@ -51,7 +51,7 @@ dispatchEvent: jest.fn(), }); -describe('', () => { +describe(' available actions rendered', () => { let mockedChronik; beforeEach(async () => { // Mock the app with context at the Send screen @@ -151,16 +151,8 @@ // The Burn switch is present expect(screen.getByTitle('Toggle Burn')).toBeInTheDocument(); - // The Mint switch is present but disabled - expect(screen.getByTitle('Toggle Mint')).toHaveProperty( - 'disabled', - true, - ); - - // We have expected mint disabled label - expect( - screen.getByText('Mint (disabled, no mint baton in wallet)'), - ).toBeInTheDocument(); + // The Mint switch is not rendered + expect(screen.queryByTitle('Toggle Mint')).not.toBeInTheDocument(); }); it('SLP1 variable supply token with mint baton', async () => { render(