This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@temporg/ui-test-locator
TypeScript icon, indicating that this package has built-in type declarations

99.10.0 • Public • Published

category: packages

ui-test-locator

npm build-status MIT License Code of Conduct

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

Installation

yarn add @temporg/ui-test-locator

Usage

// 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()
})

Readme

Keywords

none

Package Sidebar

Install

npm i @temporg/ui-test-locator

Weekly Downloads

0

Version

99.10.0

License

MIT

Unpacked Size

14.7 kB

Total Files

9

Last publish

Collaborators

  • npm