import React from 'react'; import { composeStories } from '@storybook/react-vite'; import { render as testRender } from '../../../vitest/render'; import * as stories from './IconButton.stories'; const composedStories = composeStories(stories); describe('IconButton Story Snapshots', () => { it('has tests for all stories', () => { const storyNames = Object.keys(composedStories); const testedStories = new Set([ 'Default', 'Disabled', 'Loading', 'Primary', 'Secondary', 'Action', 'Destructive', 'Ghost', ]); const untestedStories = storyNames.filter(name => !testedStories.has(name)); expect(untestedStories).toEqual([]); }); it('renders Default story', () => { const Story = composedStories.Default; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders Disabled story', () => { const Story = composedStories.Disabled; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders Loading story', () => { const Story = composedStories.Loading; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders Primary story', () => { const Story = composedStories.Primary; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders Secondary story', () => { const Story = composedStories.Secondary; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders Action story', () => { const Story = composedStories.Action; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders Destructive story', () => { const Story = composedStories.Destructive; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders Ghost story', () => { const Story = composedStories.Ghost; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); });