1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-28 23:06:37 +01:00
metamask-extension/ui/components/app/signature-request/signature-request.stories.js
Niranjana Binoy 0c203d0518
Signature-Request refactor (#19104)
* refactoring signature-request and adding test coverage

* adding storybook and removing the reduntant files:

* adding new components from

* replacing <SiteOrigin/> with <TagUrl/>

* updating review comments from Jyoti and George

* adding the hook

* refactoring in the changes from #18770 MMI PR

* adding new hook for the MMISign changes

* updating lavamoat

* updating lavamoat

* removing a commeted line

* updating the sign check with accountType conditional

* fixing build issues

* updating the review comments on the hooks

* updating signatureRequestHeader

* lint fix

* fixing test failure

* lint fix

* updating review comments

* adding the renamed hook

* updating the origin url

* fixing test failure

* migrating changes from #19184

* updating snapshot

* fixing e2e failure

* fixing e2e failure

* addressing review comments from Joao

* migrating chnages from #19892

* moving shallowEqual inside of mmi build

* migrating changes from #19881

* fixing build failure

* migrating changes from #19949

* migrating changes from #19468

* updating snapshot

* updating snapshot

* updating QA review comments

* fixing full screen height issue from develop

* migrating changes from #20083

* fixing snapshot
2023-07-20 18:51:38 +01:00

92 lines
2.2 KiB
JavaScript

import React from 'react';
import { Provider } from 'react-redux';
import configureStore from '../../../store/store';
import testData from '../../../../.storybook/test-data';
import README from './README.mdx';
import SignatureRequest from './signature-request';
const store = configureStore({
...testData,
metamask: {
...testData.metamask,
selectedAddress: '0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e',
},
});
export default {
title: 'Components/App/SignatureRequest',
decorators: [(story) => <Provider store={store}>{story()}</Provider>],
component: SignatureRequest,
parameters: {
docs: {
page: README,
},
},
argTypes: {
txData: { control: 'object' },
},
};
export const DefaultStory = (args) => {
return <SignatureRequest {...args} />;
};
DefaultStory.storyName = 'Default';
DefaultStory.args = {
txData: {
msgParams: {
from: '0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e',
data: JSON.stringify({
domain: {
name: 'happydapp.website',
},
message: {
string: 'haay wuurl',
number: 42,
},
primaryType: 'Mail',
types: {
EIP712Domain: [
{ name: 'name', type: 'string' },
{ name: 'version', type: 'string' },
{ name: 'chainId', type: 'uint256' },
{ name: 'verifyingContract', type: 'address' },
],
Group: [
{ name: 'name', type: 'string' },
{ name: 'members', type: 'Person[]' },
],
Mail: [
{ name: 'from', type: 'Person' },
{ name: 'to', type: 'Person[]' },
{ name: 'contents', type: 'string' },
],
Person: [
{ name: 'name', type: 'string' },
{ name: 'wallets', type: 'address[]' },
],
},
}),
origin: 'https://happydapp.website/',
},
},
};
export const AccountMismatchStory = (args) => {
return <SignatureRequest {...args} />;
};
AccountMismatchStory.storyName = 'AccountMismatch';
AccountMismatchStory.args = {
...DefaultStory.args,
txData: {
msgParams: {
...DefaultStory.args.txData.msgParams,
from: '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4',
},
},
};