Skip to content

Commit

Permalink
Merge pull request #13262 from Baystef/feat/mergeinfographic-story
Browse files Browse the repository at this point in the history
Create story tests for MergeInfoGraphic component [#13242]
  • Loading branch information
corwintines authored Aug 6, 2024
2 parents 45070df + 1bc2532 commit 596e24c
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 8 deletions.
1 change: 1 addition & 0 deletions .storybook/i18next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const ns = [
"page-upgrades",
"page-developers-index",
"page-what-is-ethereum",
"page-upgrades-index",
] as const
const supportedLngs = Object.keys(baseLocales)

Expand Down
6 changes: 3 additions & 3 deletions src/@chakra-ui/components/Accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const { defineMultiStyleConfig, definePartsStyle } =

const baseStyle = definePartsStyle({
container: {
'& > :is(h2, h3)': {
"& > :is(h2, h3)": {
fontSize: "initial",
fontWeight: 'initial'
}
fontWeight: "initial",
},
},
button: {
py: "2",
Expand Down
36 changes: 36 additions & 0 deletions src/components/MergeInfographic/MergeInfographic.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Box } from "@chakra-ui/react"
import { Meta, StoryObj } from "@storybook/react"

import { ContentContainer } from "@/components/MdComponents"

import { langViewportModes } from "../../../.storybook/modes"

import MergeInfographicComponent from "."

const meta = {
title: "Atoms / Media & Icons / MergeInfographic",
component: MergeInfographicComponent,
parameters: {
layout: "fullscreen",
chromatic: {
modes: {
...langViewportModes,
},
},
},
decorators: [
(Story) => (
<Box maxW="1008px" mx="auto">
<ContentContainer>
<Story />
</ContentContainer>
</Box>
),
],
} satisfies Meta<typeof MergeInfographicComponent>

export default meta

type Story = StoryObj<typeof meta>

export const MergeInfographic: Story = {}
8 changes: 3 additions & 5 deletions src/components/ui/__stories__/Heading.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const meta = {
},
decorators: [
(Story) => (
<Center className='flex-col min-h-[100vh]'>
<Center className="min-h-[100vh] flex-col">
<Story />
</Center>
),
Expand All @@ -31,7 +31,7 @@ export default meta

type Story = StoryObj<typeof meta>

const headings = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const
const headings = ["h1", "h2", "h3", "h4", "h5", "h6"] as const

export const Heading: Story = {
render: () => (
Expand All @@ -42,9 +42,7 @@ export const Heading: Story = {
</div>
<Stack>
{headings.map((Heading) => (
<Heading key={Heading}>
{`${Heading} base component`}
</Heading>
<Heading key={Heading}>{`${Heading} base component`}</Heading>
))}
</Stack>
</>
Expand Down

0 comments on commit 596e24c

Please sign in to comment.