UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

31 lines 1.16 kB
import React from 'react'; import { shallow } from 'enzyme'; import { common } from '../../util/generic-tests'; import Underline from './Underline'; describe('Underline', function () { common(Underline); it('should match snapshot for default props', function () { expect(shallow( /*#__PURE__*/React.createElement(Underline, null), { disableLifecycleMethods: true })).toMatchSnapshot(); }); it('should match snapshot for default props with children', function () { expect(shallow( /*#__PURE__*/React.createElement(Underline, null, "foo bar baz"), { disableLifecycleMethods: true })).toMatchSnapshot(); }); it('should match snapshot for string match with children', function () { expect(shallow( /*#__PURE__*/React.createElement(Underline, { match: "bar" }, "foo bar baz"), { disableLifecycleMethods: true })).toMatchSnapshot(); }); it('should match snapshot for regex match with children', function () { expect(shallow( /*#__PURE__*/React.createElement(Underline, { match: /foo?/i }, "foo bar baz"), { disableLifecycleMethods: true })).toMatchSnapshot(); }); });