Skip to content

Commit

Permalink
CU-86a5wz9dc-NEON3 - Onboarding - Change "My First Wallet" to have on…
Browse files Browse the repository at this point in the history
…e account for each supported network
  • Loading branch information
hotequil committed Dec 17, 2024
1 parent fa15a3d commit 0634edd
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/renderer/src/routes/pages/Wallets/AccountList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { AccountIcon } from '@renderer/components/AccountIcon'
import { Separator } from '@renderer/components/Separator'
import { Tooltip } from '@renderer/components/Tooltip'
import { NumberHelper } from '@renderer/helpers/NumberHelper'
import { TestHelper } from '@renderer/helpers/TestHelper'
import { useAccountsByWalletIdSelector } from '@renderer/hooks/useAccountSelector'
import { useBalances } from '@renderer/hooks/useBalances'
import { useCurrencySelector } from '@renderer/hooks/useSettingsSelector'
Expand Down Expand Up @@ -51,7 +52,10 @@ export const AccountList = ({ selectedWallet, selectedAccount, onSelect }: TProp
const { accountsByWalletId } = useAccountsByWalletIdSelector(selectedWallet.id)

return (
<ul className="flex flex-grow flex-col min-h-0 min-w-0 w-full overflow-y-auto">
<ul
{...TestHelper.buildTestObject('accounts-wallet-list')}
className="flex flex-grow flex-col min-h-0 min-w-0 w-full overflow-y-auto"
>
{accountsByWalletId.map((account, index) => (
<Fragment key={account?.id}>
<AccountItem
Expand Down
15 changes: 10 additions & 5 deletions src/renderer/src/routes/pages/Welcome/SecuritySetup/Step2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { TestHelper } from '@renderer/helpers/TestHelper'
import { useActions } from '@renderer/hooks/useActions'
import { useBlockchainActions } from '@renderer/hooks/useBlockchainActions'
import { useSettingsActions } from '@renderer/hooks/useSettingsSelector'
import { blockchainNames } from '@renderer/libs/blockchainService'

type TFormData = {
confirmPassword: string
Expand Down Expand Up @@ -57,11 +58,15 @@ export const WelcomeSecuritySetupStep2Page = ({ onSubmit }: TProps) => {
mnemonic: words.join(' '),
})

await createStandardAccount({
wallet,
blockchain: 'neo3',
name: commonT('account.defaultName', { accountNumber: 1 }),
})
const promises = blockchainNames.map(blockchain =>
createStandardAccount({
wallet,
blockchain,
name: commonT('account.defaultName', { accountNumber: 1 }),
})
)

await Promise.allSettled(promises)

navigate('/welcome-security-setup/3')
}
Expand Down
14 changes: 14 additions & 0 deletions tests/e2e/welcome/create-new-wallet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,18 @@ test.describe('Create new wallet', () => {

await window.close()
})

test('Should create a wallet with accounts for each chain', async () => {
const window = await launch()

await createNewWallet(window)

await window.getByTestId('sidebar-link-wallets').click()

const accountsLength = await window.getByTestId('accounts-wallet-list').locator('> li').count()

expect(accountsLength).toBeGreaterThan(1)

await window.close()
})
})

0 comments on commit 0634edd

Please sign in to comment.