import React from 'react'; import { composeStories } from '@storybook/react-vite'; import { render as testRender } from '../../../../vitest/render'; import * as stories from './MultiSelect.stories'; const composedStories = composeStories(stories); describe('MultiSelect Story Snapshots', () => { it('has tests for all stories', () => { const storyNames = Object.keys(composedStories); const testedStories = new Set([ 'Default', 'DropdownMode', 'ContentMode', 'WithDefaultValue', 'Error', 'Warning', 'Disabled', 'DisabledValues', 'HideSelectAll', 'EmptyOptions', 'ContentModeWithSections', ]); 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 DropdownMode story', () => { const Story = composedStories.DropdownMode; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders ContentMode story', () => { const Story = composedStories.ContentMode; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
Apple
Banana
Cherry
Orange
Lemon
Lime
Strawberry
Blueberry
Raspberry
`); }); it('renders WithDefaultValue story', () => { const Story = composedStories.WithDefaultValue; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders Error story', () => { const Story = composedStories.Error; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders Warning story', () => { const Story = composedStories.Warning; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders Disabled story', () => { const Story = composedStories.Disabled; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders DisabledValues story', () => { const Story = composedStories.DisabledValues; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders HideSelectAll story', () => { const Story = composedStories.HideSelectAll; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders EmptyOptions story', () => { const Story = composedStories.EmptyOptions; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders ContentModeWithSections story', () => { const Story = composedStories.ContentModeWithSections; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
Apple
Banana
Cherry
Orange
Lemon
Lime
Strawberry
Blueberry
Raspberry
`); }); });