import { create } from 'react-test-renderer'; import TapArea from './TapArea'; test('TapArea renders', () => { const tree = create( {}}>TapArea).toJSON(); expect(tree).toMatchSnapshot(); }); test('TapArea sets correct mouse cursor', () => { const tree = create( {}}> TapArea , ).toJSON(); expect(tree).toMatchSnapshot(); }); test('TapArea sets correct rounding', () => { const tree = create( {}} rounding="circle"> TapArea , ).toJSON(); expect(tree).toMatchSnapshot(); }); test('TapArea sets fullWidth correctly', () => { const tree = create( {}}> TapArea , ).toJSON(); expect(tree).toMatchSnapshot(); }); test('TapArea sets fullHeight correctly', () => { const tree = create( {}}> TapArea , ).toJSON(); expect(tree).toMatchSnapshot(); }); test('TapArea supports press style', () => { const tree = create( {}} tapStyle="compress"> TapArea , ).toJSON(); expect(tree).toMatchSnapshot(); }); test('accessibilityControls', () => { const instance = create( {}}> TapArea , ).root; expect( instance.find((element: any) => element.type === 'div' && element.props.role === 'button') .props['aria-controls'], ).toContain('another-element'); }); test('accessibilityExpanded', () => { const instance = create( {}}> TapArea , ).root; expect( instance.find((element: any) => element.type === 'div' && element.props.role === 'button') .props['aria-expanded'], ).toBe(true); }); test('accessibilityHaspopup', () => { const instance = create( {}}> TapArea , ).root; expect( instance.find((element: any) => element.type === 'div' && element.props.role === 'button') .props['aria-haspopup'], ).toBe(true); }); test('accessibilityLabel', () => { const instance = create( {}}> TapArea , ).root; expect( instance.find((element: any) => element.type === 'div' && element.props.role === 'button') .props['aria-label'], ).toContain('hello'); });