import { render, screen } from '@testing-library/react';
import { composeStories } from '@storybook/react';
import '@testing-library/jest-dom';

import * as DemoStories from './demo.stories';

const { Base{{COMPONENT_CLASS_NAME}} } = composeStories(DemoStories);

test('renders {{COMPONENT_CLASS_NAME}}', async () => {
  render(<Base{{COMPONENT_CLASS_NAME}} />);
  expect(await screen.findByText('{{COMPONENT_LABEL}}')).toBeVisible();
  expect(await screen.findByText('C-1001')).toBeInTheDocument();
  expect(await screen.findByText('Subheading for {{COMPONENT_LABEL}}')).toBeInTheDocument();
  expect(await screen.findByText('My Case Type')).toBeInTheDocument();
  expect(await screen.findByText('Status')).toBeVisible();
  expect(await screen.findByText('Open')).toBeVisible();
  expect(await screen.findByText('Details')).toBeVisible();
  expect(await screen.findByText('History')).toBeVisible();
});
