1 | ---
|
2 | category: packages
|
3 | ---
|
4 |
|
5 | ## ui-test-utils
|
6 |
|
7 | [![npm][npm]][npm-url]
|
8 | [![MIT License][license-badge]][license]
|
9 | [![Code of Conduct][coc-badge]][coc]
|
10 |
|
11 | A UI testing library made by Instructure Inc.
|
12 |
|
13 | ### Installation
|
14 |
|
15 | ```sh
|
16 | npm install @instructure/ui-test-utils
|
17 | ```
|
18 |
|
19 | ### Usage
|
20 |
|
21 | ```javascript
|
22 | import { mount, expect, find } from '@instructure/ui-test-utils'
|
23 |
|
24 | import MyComponent from '../'
|
25 |
|
26 | it('should render children', async () => {
|
27 | await mount(<MyComponent>Hello World</MyComponent>)
|
28 | expect(await find(':contains(Hello World)')).to.exist()
|
29 | })
|
30 | ```
|
31 |
|
32 | [npm]: https://img.shields.io/npm/v/@instructure/ui-test-utils.svg
|
33 | [npm-url]: https://npmjs.com/package/@instructure/ui-test-utils
|
34 | [license-badge]: https://img.shields.io/npm/l/instructure-ui.svg?style=flat-square
|
35 | [license]: https://github.com/instructure/instructure-ui/blob/master/LICENSE
|
36 | [coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
|
37 | [coc]: https://github.com/instructure/instructure-ui/blob/master/CODE_OF_CONDUCT.md
|