-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
39 additions
and
38 deletions.
There are no files selected for viewing
42 changes: 4 additions & 38 deletions
42
app/components/Views/confirmations/Confirm/Confirm.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,48 +1,14 @@ | ||
import React from 'react'; | ||
|
||
import renderWithProvider from '../../../../util/test/renderWithProvider'; | ||
import { backgroundState } from '../../../../util/test/initial-root-state'; | ||
import { personalSignatureConfirmationState } from '../../../../util/test/confirm-data-helpers'; | ||
import Confirm from './index'; | ||
|
||
process.env.REDESIGNED_SIGNATURE_REQUEST = 'true'; | ||
|
||
const initialState = { | ||
engine: { | ||
backgroundState: { | ||
...backgroundState, | ||
ApprovalController: { | ||
pendingApprovals: { | ||
'76b33b40-7b5c-11ef-bc0a-25bce29dbc09': { | ||
id: '76b33b40-7b5c-11ef-bc0a-25bce29dbc09', | ||
origin: 'metamask.github.io', | ||
type: 'personal_sign', | ||
time: 1727282253048, | ||
requestData: { | ||
data: '0x4578616d706c652060706572736f6e616c5f7369676e60206d657373616765', | ||
from: '0x935e73edb9ff52e23bac7f7e043a1ecd06d05477', | ||
meta: { | ||
url: 'https://metamask.github.io/test-dapp/', | ||
title: 'E2E Test Dapp', | ||
icon: { uri: 'https://metamask.github.io/metamask-fox.svg' }, | ||
analytics: { request_source: 'In-App-Browser' }, | ||
}, | ||
origin: 'metamask.github.io', | ||
metamaskId: '76b33b40-7b5c-11ef-bc0a-25bce29dbc09', | ||
}, | ||
requestState: null, | ||
expectsResult: true, | ||
}, | ||
}, | ||
pendingApprovalCount: 1, | ||
approvalFlows: [], | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
describe('Confirm', () => { | ||
it('should match snapshot for personal sign', async () => { | ||
const container = renderWithProvider(<Confirm />, { state: initialState }); | ||
const container = renderWithProvider(<Confirm />, { | ||
state: personalSignatureConfirmationState, | ||
}); | ||
expect(container).toMatchSnapshot(); | ||
}); | ||
}); |
Empty file.
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,35 @@ | ||
import { backgroundState } from './initial-root-state'; | ||
|
||
export const personalSignatureConfirmationState = { | ||
engine: { | ||
backgroundState: { | ||
...backgroundState, | ||
ApprovalController: { | ||
pendingApprovals: { | ||
'76b33b40-7b5c-11ef-bc0a-25bce29dbc09': { | ||
id: '76b33b40-7b5c-11ef-bc0a-25bce29dbc09', | ||
origin: 'metamask.github.io', | ||
type: 'personal_sign', | ||
time: 1727282253048, | ||
requestData: { | ||
data: '0x4578616d706c652060706572736f6e616c5f7369676e60206d657373616765', | ||
from: '0x935e73edb9ff52e23bac7f7e043a1ecd06d05477', | ||
meta: { | ||
url: 'https://metamask.github.io/test-dapp/', | ||
title: 'E2E Test Dapp', | ||
icon: { uri: 'https://metamask.github.io/metamask-fox.svg' }, | ||
analytics: { request_source: 'In-App-Browser' }, | ||
}, | ||
origin: 'metamask.github.io', | ||
metamaskId: '76b33b40-7b5c-11ef-bc0a-25bce29dbc09', | ||
}, | ||
requestState: null, | ||
expectsResult: true, | ||
}, | ||
}, | ||
pendingApprovalCount: 1, | ||
approvalFlows: [], | ||
}, | ||
}, | ||
}, | ||
} |