// @flow
import React from 'react';
import { itIsAccessible } from '../../../../utils/tests';

import type { ControllableExpanderProps } from './controllable-expander.proptypes';
import { ControllableExpander } from './index';

const DEFAULT_PROPS: ControllableExpanderProps = {
  isOpen: false,
  onToggle: () => {},
  HeadingComponent: ({ isOpen = false }) => (
    <div>{isOpen ? 'Close me' : 'Open me'}</div>
  ),
};

describe('ControllableExpander', () => {
  itIsAccessible(
    <div>
      <ControllableExpander {...DEFAULT_PROPS} isOpen>
        <div>Expandable content</div>
      </ControllableExpander>
    </div>,
  );
});
