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 | ```js
|
22 | ---
|
23 | type: code
|
24 | ---
|
25 | import { mount, expect, find } from '@instructure/ui-test-utils'
|
26 |
|
27 | import MyComponent from '../'
|
28 |
|
29 | it('should render children', async () => {
|
30 | await mount(<MyComponent>Hello World</MyComponent>)
|
31 | expect(await find(':contains(Hello World)')).to.exist()
|
32 | })
|
33 | ```
|
34 |
|
35 | [npm]: https://img.shields.io/npm/v/@instructure/ui-test-utils.svg
|
36 | [npm-url]: https://npmjs.com/package/@instructure/ui-test-utils
|
37 | [license-badge]: https://img.shields.io/npm/l/instructure-ui.svg?style=flat-square
|
38 | [license]: https://github.com/instructure/instructure-ui/blob/master/LICENSE
|
39 | [coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
|
40 | [coc]: https://github.com/instructure/instructure-ui/blob/master/CODE_OF_CONDUCT.md
|