# @temporg/ui-test-locator

> A locator component for finding components by their defined selector in tests.

Latest version **99.10.0** (published 2020-06-02) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @temporg/ui-test-locator
pnpm add @temporg/ui-test-locator
yarn add @temporg/ui-test-locator
bun add @temporg/ui-test-locator
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 99.10.0 |
| Published | 2020-06-02 |
| First published | 2020-01-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 14.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Rock Content Product and Engineering Team |
| Maintainers | matheusrv |

## Links

- npm: https://www.npmjs.com/package/@temporg/ui-test-locator
- Repository: https://github.com/rockcontent/rock-design-system
- Homepage: https://design.rockcontent.com/
- Issues: https://github.com/rockcontent/rock-design-system/issues
- npm.io page: https://npm.io/package/@temporg/ui-test-locator

## Dependencies (2)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.5.0
- [@temporg/ui-test-queries](https://npm.io/package/@temporg/ui-test-queries.md) ^99.10.0

## Recent versions

- 99.10.0 (latest) — 2020-06-02
- 99.9.0 — 2020-04-27
- 99.8.0 — 2020-04-24
- 99.7.0 — 2020-04-23
- 99.6.0 — 2020-04-23
- 99.5.0 — 2020-04-22
- 99.4.0 — 2020-04-22
- 99.3.0 — 2020-04-20
- 99.2.0 — 2020-04-20
- 99.1.0 — 2020-04-17
- 0.8.12 — 2020-04-16
- 0.8.11 — 2020-04-13
- 0.8.9 — 2020-04-06
- 0.8.0 — 2020-03-31
- 0.0.1 — 2020-01-30

## README

---
category: packages
---

## ui-test-locator

[![npm][npm]][npm-url]
[![build-status][build-status]][build-status-url]
[![MIT License][license-badge]][LICENSE]
[![Code of Conduct][coc-badge]][coc]

A locator component for finding components by their defined selector in tests.

### Installation

```sh
yarn add @temporg/ui-test-locator
```

### Usage

```javascript
// MyComponent.js
import { testable } from '@temporg/ui-testable'

@testable()
export class MyComponent extends React.Component {
  ...
}

// MyComponentLocator.js
import { locator } from '@temporg/ui-test-locator'
import { MyComponent } from './MyComponent'

export const MyComponentLocator = locator(MyComponent.selector)

// MyComponent.test.js
import { MyComponent } from './MyComponent'
import { MyComponentLocator } from './MyComponentLocator.js'

it('should render', () => {
  await mount(<MyComponent />)

  const myComponent = await MyComponentLocator.find()

  expect(myComponent).to.exist()
})
```

[npm]: https://img.shields.io/npm/v/@temporg/ui-test-locator.svg
[npm-url]: https://npmjs.com/package/@temporg/ui-test-locator

[build-status]: https://travis-ci.org/rockcontent/rock-design-system.svg?branch=master
[build-status-url]: https://travis-ci.org/rockcontent/rock-design-system "Travis CI"

[license-badge]: https://img.shields.io/npm/l/rock-design-system.svg?style=flat-square
[license]: https://github.com/rockcontent/rock-design-system/blob/master/LICENSE

[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
[coc]: https://github.com/rockcontent/rock-design-system/blob/master/CODE_OF_CONDUCT.md

---
_Source: https://npm.io/package/@temporg/ui-test-locator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
