-
Notifications
You must be signed in to change notification settings - Fork 468
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
Showing
3 changed files
with
50 additions
and
8 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
26 changes: 26 additions & 0 deletions
26
apps/web/src/components/tx/confirmation-views/UpdateSafe/index.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { ChainInfo } from '@safe-global/safe-gateway-typescript-sdk' | ||
import { _UpdateSafe as UpdateSafe } from './index' | ||
import { render } from '@/tests/test-utils' | ||
|
||
const chain = { | ||
recommendedMasterCopyVersion: '1.4.1', | ||
} as ChainInfo | ||
|
||
const warningText = 'This upgrade will invalidate all queued transactions!' | ||
|
||
describe('Container', () => { | ||
it('renders correctly with a queue warning', async () => { | ||
const container = render(<UpdateSafe safeVersion="1.1.1" queueSize="10+" chain={chain} />) | ||
await expect(container.findByText(warningText)).resolves.not.toBeNull() | ||
}) | ||
|
||
it('renders correctly without a queue warning because no queue', async () => { | ||
const container = render(<UpdateSafe safeVersion="1.1.1" queueSize="" chain={chain} />) | ||
await expect(container.findByText(warningText)).rejects.toThrowError(Error) | ||
}) | ||
|
||
it('renders correctly without a queue warning because of compatible Safe version', async () => { | ||
const container = render(<UpdateSafe safeVersion="1.3.0" queueSize="10" chain={chain} />) | ||
await expect(container.findByText(warningText)).rejects.toThrowError(Error) | ||
}) | ||
}) |
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