import { render } from '~/src/utils/test' import { Stack } from './Stack' import styles from './Stack.module.scss' describe('Stack', () => { describe('Flex layout', () => { it('creates a flexbox', () => { const { getByTestId } = render( ) expect(getByTestId('stack')).toHaveClass(styles.Stack) expect(getByTestId('stack')).toHaveClass(styles['display-flex']) }) it('creates a horizontal flexbox when given direction="horizontal"', () => { const { getByTestId } = render( ) expect(getByTestId('stack')).toHaveClass(styles['direction-horizontal']) expect(getByTestId('stack')).toHaveStyle('--b-stack-spacing: 10px') }) it('creates a vertical flexbox when given direction="vertical"', () => { const { getByTestId } = render( ) expect(getByTestId('stack')).toHaveClass(styles['direction-vertical']) expect(getByTestId('stack')).toHaveStyle('--b-stack-spacing: 10px') }) }) describe('Supports BezierComponentProps interface', () => { it('supports style prop', () => { const { getByTestId } = render( ) expect(getByTestId('stack')).toHaveStyle({ 'background-color': 'red' }) }) it('supports className prop', () => { const { getByTestId } = render( ) expect(getByTestId('stack')).toHaveClass('foo') }) }) })