rut-dom
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

Rut DOM

Build Status npm version npm deps

React DOM testing made easy! Rut DOM is a Rut testing adapter that provides a simple streamlined API for writing component based integration tests.

import { render } from 'rut-dom';
import Input, { InputProps } from '../src/Input';
 
describe('<Input />', () => {
  it('renders an input field', () => {
    const { root, update } = render<InputProps>(<Input name="rut" value="foo" />);
 
    expect(root).toHaveProp('name', 'rut');
    expect(root).toHaveValue('foo');
    expect(root).not.toBeDisabled();
 
    update({ disabled: true });
 
    expect(root).toBeDisabled();
  });
});

Requirements

  • React 16.9+ (Rut v1)
  • React 17+ (Rut v2)

Installation

yarn add --dev rut-dom react react-dom

Documentation

https://milesj.gitbook.io/rut

Readme

Keywords

Package Sidebar

Install

npm i rut-dom

Weekly Downloads

4

Version

2.0.0

License

MIT

Unpacked Size

23.6 kB

Total Files

16

Last publish

Collaborators

  • milesj