How to use the react-addons-test-utils.isElementOfType function in react-addons-test-utils

To help you get started, we’ve selected a few react-addons-test-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github imbhargav5 / dictionary-offline / tests / components / Appbar.js View on Github external
it('is an element', function() {
    var TestUtils = require('react-addons-test-utils');
    var Appbar = require('../../app/client/components/Appbar');

    assert.equal(true,TestUtils.isElementOfType(,Appbar));

    // // Render a checkbox with label in the document
    // var checkbox = TestUtils.renderIntoDocument(
    //   
    // );

    // // Verify that it's Off by default
    // var label = TestUtils.findRenderedDOMComponentWithTag(
    //   checkbox, 'label');
    // assert.equal(label.getDOMNode().textContent, 'Off');

    // // Simulate a click and verify that it is now On
    // var input = TestUtils.findRenderedDOMComponentWithTag(
    //   checkbox, 'input');
    // TestUtils.Simulate.change(input);
    // assert.equal(label.getDOMNode().textContent, 'On');
github adazzle / react-data-grid / packages / react-data-grid / src / __tests__ / HeaderRow.spec.js View on Github external
it('should provide column with a filterableHeaderRenderer', () => {
        let headerCells = TestUtils.scryRenderedComponentsWithType(headerRow, HeaderCellStub);
        expect(TestUtils.isElementOfType(headerCells[sortableAndFilterableColIdx].props.renderer, FilterableHeaderCellStub)).toBe(true);
      });
    });
github adazzle / react-data-grid / packages / react-data-grid / src / __tests__ / HeaderRow.spec.js View on Github external
it('should render custom column header', () => {
      let headerCells = TestUtils.scryRenderedComponentsWithType(headerRow, HeaderCellStub);
      expect(TestUtils.isElementOfType(headerCells[customColumnIdx].props.renderer, CustomHeaderStub)).toBe(true);
    });
github mspae / react-wavesurfer / test / react-wavesurfer.spec.js View on Github external
it('should render component', () => {
    expect(TestUtils.isElementOfType(component), Wavesurfer);
  });
github Dindaleon / hapi-react-starter-kit / test / components / Layout.spec.js View on Github external
it( 'should contain children', () => {
      expect( typeof TestUtils.isElementOfType( component.props.children ) !== 'undefined' ).to.be.true;
    });
  });
github vesparny / react-kickstart / test / components / App.spec.js View on Github external
test('is properly shaped', (t) => {
  const component = utils.shallowlyRenderedOutput(<div>)

  t.truthy(component.type === 'div', 'should have a div as container')
  t.truthy(typeof TestUtils.isElementOfType(component.props.children) !== 'undefined', 'should contain children')
})
</div>
github AndrewKeig / react-speech / test / speech.js View on Github external
it('should render component', () => {
      expect(TestUtils.isElementOfType(component), Speech);
    });
github adazzle / react-data-grid / packages / react-data-grid / src / __tests__ / HeaderRow.spec.js View on Github external
it('should provide column with a sortableHeaderRenderer', () => {
      let headerCells = TestUtils.scryRenderedComponentsWithType(headerRow, HeaderCellStub);
      expect(TestUtils.isElementOfType(headerCells[sortableColIdx].props.renderer, SortableHeaderCellStub)).toBe(true);
    });
github pzavolinsky / react-unit / src / react-unit.jsx View on Github external
return this.findBy(e => e.componentInstance &&
      TestUtils.isElementOfType(e.componentInstance, componentClass));
  }
github appnexus / lucid / src / util / child-component.spec.jsx View on Github external
_.forEach(labelElements, (labelElement) => {
						assert(isElementOfType(labelElement, LabeledField.Label));
					});