-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2091203
commit fcc0610
Showing
16 changed files
with
567 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 25 additions & 36 deletions
61
src/__tests__/scenes/CreateWalletAccountSetupScene.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
}) | ||
}) |
Oops, something went wrong.