import React from 'react';
import { render } from '@testing-library/react';
import { testComponent } from 'lib/test-utils/common';
import { Control, Props, CLASS_NAME } from '../control';

describe('<Control>', () => {
    const defaultProps: Props = {
        errorMessage: 'error',
        note: 'note',
        children: <></>,
    };

    testComponent(Control, defaultProps, CLASS_NAME);

    test('applies style', () => {
        const { getByTestId } = render(<Control {...defaultProps} style={{ marginTop: 10 }} />);
        expect(getByTestId(CLASS_NAME)).toHaveStyle({ marginTop: '10px' });
    });
});
