nexxtway/react-rainbow

View on GitHub
src/components/PrimitiveCheckbox/__test__/label.spec.js

Summary

Maintainability
A
2 hrs
Test Coverage
import React from 'react';
import { mount } from 'enzyme';
import Label from '../label';

describe('<InputCheckboxLabel/>', () => {
    it('should set the inputId passed as the htmlFor prop in the label element', () => {
        const component = mount(<Label label="Input Label" inputId="input-213" />);
        expect(component.find('label').prop('htmlFor')).toBe('input-213');
    });
});