Skip to content

Commit

Permalink
Rewrite the EOS handle scene
Browse files Browse the repository at this point in the history
  • Loading branch information
swansontec committed Jul 25, 2023
1 parent 2091203 commit fcc0610
Show file tree
Hide file tree
Showing 16 changed files with 567 additions and 379 deletions.
2 changes: 0 additions & 2 deletions src/__tests__/reducers/__snapshots__/RootReducer.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ exports[`initialState 1`] = `
"activationCost": "",
"supportedAssets": [],
},
"handleAvailableStatus": "",
"isCheckingHandleAvailability": false,
"walletAccountActivationPaymentInfo": {
"amount": "",
"currencyCode": "",
Expand Down
2 changes: 0 additions & 2 deletions src/__tests__/reducers/createWalletReducer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ test('initialState', () => {
exchangeAmount: '',
expireTime: 0
},
isCheckingHandleAvailability: false,
handleAvailableStatus: '',
handleActivationInfo: {
supportedAssets: [],
activationCost: ''
Expand Down
61 changes: 25 additions & 36 deletions src/__tests__/scenes/CreateWalletAccountSetupScene.test.tsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,35 @@
import { describe, expect, it } from '@jest/globals'
import * as React from 'react'
import { createRenderer } from 'react-test-renderer/shallow'
import TestRenderer from 'react-test-renderer'

import { CreateWalletAccountSetup } from '../../components/scenes/CreateWalletAccountSetupScene'
import { CreateWalletAccountSetupScene } from '../../components/scenes/CreateWalletAccountSetupScene'
import { FakeProviders } from '../../util/fake/FakeProviders'
import { fakeSceneProps } from '../../util/fake/fakeSceneProps'

describe('CreateWalletAccountSelect', () => {
const fakeAccount: any = {
currencyConfig: {
bitcoin: {
allTokens: {},
currencyInfo: { pluginId: 'bitcoin', currencyCode: 'BTC' }
} as any
}
}

it('should render with loading props', () => {
const renderer = createRenderer()

const actual = renderer.render(
<CreateWalletAccountSetup
{...fakeSceneProps('createWalletAccountSetup', {
accountHandle: '',
selectedWalletType: {
currencyName: 'bitcoin',
walletType: 'wallet:bitcoin',
currencyCode: 'BTC'
} as any,
selectedFiat: {
label: 'USD',
value: 'USD'
},
isReactivation: true,
existingWalletId: 'myWallet'
})}
handleAvailableStatus="AVAILABLE"
isCheckingHandleAvailability
account={fakeAccount}
checkHandleAvailability={handle => undefined}
/>
it('renders', () => {
const renderer = TestRenderer.create(
<FakeProviders>
<CreateWalletAccountSetupScene
{...fakeSceneProps('createWalletAccountSetup', {
accountHandle: '',
selectedWalletType: {
currencyName: 'bitcoin',
walletType: 'wallet:bitcoin',
currencyCode: 'BTC'
} as any,
selectedFiat: {
label: 'USD',
value: 'USD'
},
isReactivation: true,
existingWalletId: 'myWallet'
})}
/>
</FakeProviders>
)

expect(actual).toMatchSnapshot()
expect(renderer.toJSON()).toMatchSnapshot()
renderer.unmount()
})
})
Loading

0 comments on commit fcc0610

Please sign in to comment.