UNPKG

wix-style-react

Version:
41 lines (34 loc) 1.43 kB
import React from 'react'; import textLinkDriverFactory from './TextLink.driver'; import TextLink from './TextLink'; import { createDriverFactory } from 'wix-ui-test-utils/driver-factory'; import { tpaTextLinkTestkitFactory as textLinkTestkitFactory } from '../../../testkit'; import { tpaTextLinkTestkitFactory as enzymeTextLinkTestkitFactory } from '../../../testkit/enzyme'; import { isTestkitExists, isEnzymeTestkitExists } from '../../../test/utils/testkit-sanity'; import { mount } from 'enzyme'; describe('TextLink', function () { var createDriver = createDriverFactory(textLinkDriverFactory); it('should have a textLink', function () { var driver = createDriver(React.createElement(TextLink, { link: '' })); expect(driver.exists()).toBeTruthy(); }); it('should render children', function () { var children = '<div>123</div>'; var driver = createDriver(React.createElement( TextLink, { link: '' }, children )); expect(driver.getTextContent()).toBe(children); }); }); describe('testkit', function () { it('should exist', function () { expect(isTestkitExists(React.createElement(TextLink, { link: '' }), textLinkTestkitFactory)).toBe(true); }); }); describe('enzyme testkit', function () { it('should exist', function () { expect(isEnzymeTestkitExists(React.createElement(TextLink, { link: '' }), enzymeTextLinkTestkitFactory, mount)).toBe(true); }); });