diff --git a/apps/trading/components/welcome-dialog/get-started.spec.tsx b/apps/trading/components/welcome-dialog/get-started.spec.tsx index 01ff2dbdf..3f5c12462 100644 --- a/apps/trading/components/welcome-dialog/get-started.spec.tsx +++ b/apps/trading/components/welcome-dialog/get-started.spec.tsx @@ -22,7 +22,7 @@ describe('GetStarted', () => { }; const checkTicks = (elements: Element[]) => { elements.forEach((item, i) => { - if (i + 1 < mockStep) { + if (i + 1 < mockStep - 1) { expect(item.querySelector('[data-testid="icon-tick"]')).toBeTruthy(); } }); @@ -57,19 +57,9 @@ describe('GetStarted', () => { 'get' ); navigatorGetter.mockReturnValue('Chrome'); - mockStep = 1; - const { rerender, container } = renderComponent(); - expect(screen.queryByTestId('icon-tick')).not.toBeInTheDocument(); - expect(screen.getByTestId('get-wallet-button')).toBeInTheDocument(); mockStep = 2; - rerender( - - - - - - ); + const { rerender, container } = renderComponent(); checkTicks(screen.getAllByRole('listitem')); expect(screen.getByRole('button', { name: 'Connect' })).toBeInTheDocument(); @@ -93,7 +83,9 @@ describe('GetStarted', () => { ); checkTicks(screen.getAllByRole('listitem')); - expect(screen.getByRole('button', { name: 'Dismiss' })).toBeInTheDocument(); + expect( + screen.getByRole('button', { name: 'Ready to trade' }) + ).toBeInTheDocument(); mockStep = 5; rerender( diff --git a/apps/trading/components/welcome-dialog/get-started.tsx b/apps/trading/components/welcome-dialog/get-started.tsx index 9b6480ba5..086fdc58e 100644 --- a/apps/trading/components/welcome-dialog/get-started.tsx +++ b/apps/trading/components/welcome-dialog/get-started.tsx @@ -7,11 +7,7 @@ import { VegaIcon, VegaIconNames, } from '@vegaprotocol/ui-toolkit'; -import { - GetWalletButton, - useVegaWallet, - useVegaWalletDialogStore, -} from '@vegaprotocol/wallet'; +import { useVegaWallet, useVegaWalletDialogStore } from '@vegaprotocol/wallet'; import { Networks, useEnvironment } from '@vegaprotocol/environment'; import { useLocalStorage } from '@vegaprotocol/react-helpers'; import { useNavigate } from 'react-router-dom'; @@ -30,7 +26,6 @@ interface Props { } const GetStartedButton = ({ step }: { step: OnboardingStep }) => { - const { CHROME_EXTENSION_URL, MOZILLA_EXTENSION_URL } = useEnvironment(); const navigate = useNavigate(); const [, setOnboardingViewed] = useLocalStorage( constants.ONBOARDING_VIEWED_KEY @@ -47,15 +42,7 @@ const GetStartedButton = ({ step }: { step: OnboardingStep }) => { let onClickHandle = () => { openVegaWalletDialog(); }; - if (step === OnboardingStep.ONBOARDING_WALLET_STEP) { - return ( - - ); - } else if (step === OnboardingStep.ONBOARDING_CONNECT_STEP) { + if (step <= OnboardingStep.ONBOARDING_CONNECT_STEP) { buttonText = t('Connect'); } else if (step === OnboardingStep.ONBOARDING_DEPOSIT_STEP) { buttonText = t('Deposit'); @@ -65,7 +52,7 @@ const GetStartedButton = ({ step }: { step: OnboardingStep }) => { dismiss(); }; } else if (step === OnboardingStep.ONBOARDING_ORDER_STEP) { - buttonText = t('Dismiss'); + buttonText = t('Ready to trade'); onClickHandle = () => { navigate(link); setView({ type: ViewType.Order }); @@ -116,23 +103,18 @@ export const GetStarted = ({ lead }: Props) => {