nexxtway/react-rainbow

View on GitHub
src/components/AssistiveText/__test__/assistiveText.spec.js

Summary

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

describe('<AssistiveText/>', () => {
    it('should render the span element when the text is passed', () => {
        const component = mount(<AssistiveText text="for screen readers" />);
        expect(component.find('span').exists()).toBe(true);
    });
    it('should render the text passed', () => {
        const component = mount(<AssistiveText text="for screen readers" />);
        expect(component.text()).toBe('for screen readers');
    });
});