1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-03 22:54:29 +01:00
metamask-extension/ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.stories.js
sumit shinde ( Roni ) 52e91058a0
knob to control (#18635)
* knob to control

* Update confirm-add-suggested-token.stories.js

* fix eslint

* Update ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.stories.js

Co-authored-by: George Marshall <georgewrmarshall@gmail.com>

* Update ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.stories.js

Co-authored-by: George Marshall <georgewrmarshall@gmail.com>

* Update ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.stories.js

Co-authored-by: George Marshall <georgewrmarshall@gmail.com>

* Update ui/pages/confirm-add-suggested-token/confirm-add-suggested-token.stories.js

Co-authored-by: George Marshall <georgewrmarshall@gmail.com>

* Update confirm-add-suggested-token.stories.js

* updaes

* Updating to use redux provider

* lint fix

---------

Co-authored-by: George Marshall <georgewrmarshall@gmail.com>
Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
2023-04-19 14:33:29 +05:30

66 lines
1.7 KiB
JavaScript

/* eslint-disable react/prop-types */
import React from 'react';
import { Provider } from 'react-redux';
import { suggestedAssets as mockSuggestedAssets } from '../../../.storybook/initial-states/approval-screens/add-suggested-token';
import configureStore from '../../store/store';
import mockState from '../../../.storybook/test-data';
import ConfirmAddSuggestedToken from '.';
const store = configureStore({
metamask: {
...mockState.metamask,
suggestedAssets: [...mockSuggestedAssets],
tokens: [],
},
});
export default {
title: 'Pages/ConfirmAddSuggestedToken',
decorators: [(story) => <Provider store={store}>{story()}</Provider>],
};
export const DefaultStory = () => <ConfirmAddSuggestedToken />;
DefaultStory.storyName = 'Default';
export const WithDuplicateAddress = () => <ConfirmAddSuggestedToken />;
const WithDuplicateAddressStore = configureStore({
metamask: {
...mockState.metamask,
suggestedAssets: [...mockSuggestedAssets],
tokens: [
{
...mockSuggestedAssets[0].asset,
},
],
},
});
WithDuplicateAddress.decorators = [
(story) => <Provider store={WithDuplicateAddressStore}>{story()}</Provider>,
];
export const WithDuplicateSymbolAndDifferentAddress = () => (
<ConfirmAddSuggestedToken />
);
const WithDuplicateSymbolAndDifferentAddressStore = configureStore({
metamask: {
...mockState.metamask,
suggestedAssets: [...mockSuggestedAssets],
tokens: [
{
...mockSuggestedAssets[0].asset,
address: '0xNonSuggestedAddress',
},
],
},
});
WithDuplicateSymbolAndDifferentAddress.decorators = [
(story) => (
<Provider store={WithDuplicateSymbolAndDifferentAddressStore}>
{story()}
</Provider>
),
];