Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Create a story for GasTiming component #25557

Merged
merged 15 commits into from
Jul 30, 2024
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import { Provider } from 'react-redux';
import configureStore from '../../../../store/store';
import GasTiming from './gas-timing.component';
import mockState from '../../../../../test/data/mock-state.json';

const storeMock = configureStore({
metamask: {
...mockState.metamask,
},
});

const meta: Meta<typeof GasTiming> = {
title: 'Pages/Confirmations/Components/GasTiming',
component: GasTiming as React.ComponentType<{ maxFeePerGas?: number; maxPriorityFeePerGas?: number; gasWarnings: any }>,
decorators: [
(StoryComponent: React.FC) => (
<Provider store={storeMock}>
<StoryComponent />
</Provider>
),
],
argTypes: {
maxFeePerGas: {
control: 'string',
},
maxPriorityFeePerGas: {
control: 'string',
},
gasWarnings: {
control: 'object',
},
},
args: {
maxFeePerGas: 0,
maxPriorityFeePerGas: 0,
gasWarnings: {},
},
};

export default meta;
type Story = StoryObj<typeof GasTiming>;

export const DefaultStory: Story = {};

DefaultStory.storyName = 'Default';