import React from 'react';
import renderer from 'react-test-renderer';
import { Checkbox } from '../../..';

describe('Checkbox Component', () => {
    it('renders correctly with label and unchecked', () => {
        const tree = renderer.create(<Checkbox checked={false} label="Example Label" />).toJSON();
        expect(tree).toMatchSnapshot();
    });

    it('renders correctly with label and checked', () => {
        const tree = renderer.create(<Checkbox checked={true} label="Example Label" />).toJSON();
        expect(tree).toMatchSnapshot();
    });

    it('renders correctly without label and unchecked', () => {
        const tree = renderer.create(<Checkbox checked={false} />).toJSON();
        expect(tree).toMatchSnapshot();
    });

    it('renders correctly without label and checked', () => {
        const tree = renderer.create(<Checkbox checked={true} />).toJSON();
        expect(tree).toMatchSnapshot();
    });

    it('renders correctly when disabled and unchecked', () => {
        const tree = renderer.create(<Checkbox checked={false} disabled />).toJSON();
        expect(tree).toMatchSnapshot();
    });

    it('renders correctly when disabled and checked', () => {
        const tree = renderer.create(<Checkbox checked={true} disabled />).toJSON();
        expect(tree).toMatchSnapshot();
    });
});
