import React from 'react'; import { composeStories } from '@storybook/react-vite'; import { render as testRender } from '../../../../vitest/render'; import * as stories from './FileInput.stories'; const composedStories = composeStories(stories); describe('FileInput Story Snapshots', () => { it('has tests for all stories', () => { const storyNames = Object.keys(composedStories); const testedStories = new Set([ 'Default', 'Multiple', 'WithPreloadedFiles', 'WithFileTypes', 'DisabledState', 'WithValidationStates', 'WithTooltipAndLabels', ]); 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 Multiple story', () => { const Story = composedStories.Multiple; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders WithPreloadedFiles story', () => { const Story = composedStories.WithPreloadedFiles; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders WithFileTypes story', () => { const Story = composedStories.WithFileTypes; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
Accepts: .pdf, .doc, .docx files only
`); }); it('renders DisabledState story', () => { const Story = composedStories.DisabledState; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders WithValidationStates story', () => { const Story = composedStories.WithValidationStates; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
`); }); it('renders WithTooltipAndLabels story', () => { const Story = composedStories.WithTooltipAndLabels; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
Required
`); }); });