2.0.0 • Published 4 years ago

rut-dom v2.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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

2.0.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.2

4 years ago

0.1.1

5 years ago

0.1.0

5 years ago