wix-style-react
Version:
wix-style-react
47 lines (33 loc) • 1.23 kB
Markdown
> General modal container.
| method | arguments | returned value | description |
|--------|-----------|----------------|-------------|
| title | - | string | title |
> Unit testing example
```javascript
import React from 'react';
import {selectorTestkitFactory} from 'wix-style-react/dist/testkit';
import {selectorTestkitFactory as enzymeSelectorTestkitFactory} from 'wix-style-react/dist/testkit/enzyme';
/***************
enzyme example
***************/
const dataHook = 'myDataHook';
const wrapper = mount(<div/><Selector {...props} dataHook={dataHook}/></div>);
const testkit = enzymeSelectorTestkitFactory({wrapper, dataHook});
//Do tests
expect(testkit.isOpen()).toBeFalsy();
/**********************
ReactTestUtils example
**********************/
const div = document.createElement('div');
const dataHook = 'myDataHook';
const wrapper = div.appendChild(
ReactTestUtils.renderIntoDocument(<div/><Selector {...props} dataHook={dataHook}/></div>, {dataHook})
);
const testkit = selectorTestkitFactory({wrapper, dataHook});
//Do tests
expect(testkit.exists()).toBeTruthy();
```