diff --git a/src/components/Clickable/clickable.test.tsx b/src/components/Clickable/clickable.test.tsx new file mode 100644 index 0000000..3c880cc --- /dev/null +++ b/src/components/Clickable/clickable.test.tsx @@ -0,0 +1,33 @@ +import React from 'react' +import { render, cleanup } from '@testing-library/react' + +import Clickable, { ClickableProps } from './index' +import { AdaptProvider } from '../' +import 'jest-styled-components' + +afterEach(cleanup) + +describe('Clickable component', () => { + const renderComponent = (customProps?: ClickableProps) => + render( + + + + ) + + it('should render without crashing', () => { + const { container } = renderComponent() + expect(container.firstChild).toBeDefined() + }) + + it('should render with full styles', () => { + const { container } = renderComponent({ full: true }) + expect(container.firstChild).toHaveStyleRule('display', 'block') + expect(container.firstChild).toHaveStyleRule('width', '100%') + }) + + it('should render with disabled styles', () => { + const { container } = renderComponent({ disabled: true }) + expect(container.firstChild).toHaveStyleRule('cursor', 'not-allowed') + }) +})