import React from 'react'; import { composeStories } from '@storybook/react-vite'; import { render as testRender } from '../../../vitest/render'; import * as stories from './CodeSnippet.stories'; const composedStories = composeStories(stories); describe('CodeSnippet Story Snapshots', () => { it('has tests for all stories', () => { const storyNames = Object.keys(composedStories); const testedStories = new Set(['Default', 'Url', 'Collapsible']); 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(`
      <TextField
  as="label"
  hint="This is a hint for the text field."
  label="Text:"
  value="Text value"
/>
    
`); }); it('renders Url story', () => { const Story = composedStories.Url; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
      https://fenix.myshoptet.com/export/products.csv?patternId=36&partnerId=3&hash=0cdd73ea4224626c631226cd34f3b680ab670cea086e3232c99fa6432ae81f1f
    
`); }); it('renders Collapsible story', () => { const Story = composedStories.Collapsible; const { container } = testRender(); expect(container).toMatchInlineSnapshot(`
      <div className="v2form">
  <MultiSelectField
    as="label"
    getGroupOptions={function VG(){}}
    getOptionLabel={function VG(){}}
    getOptionValue={function VG(){}}
    label="Label"
    options={[
      {
        label: 'Option 1',
        value: '1'
      },
      {
        label: 'Option 2',
        value: '2'
      },
    ]}
  />
</div>
    
`); }); });