How to use the react-dom/test-utils.findRenderedDOMComponentWithClass function in react-dom

To help you get started, we’ve selected a few react-dom 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 rsuite / rsuite / test / TablePaginationSpec.js View on Github external
it('Should output a prev button', () => {
    const instance = getInstance();
    ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'rs-icon-page-previous');
  });
github rsuite / rsuite / test / MultiCascader / DropdownSpec.js View on Github external
it('Should render a button by toggleComponentClass={Button}', () => {
    const instance = ReactTestUtils.renderIntoDocument(
      
    );
    ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'rs-btn');
  });
});
github adazzle / react-data-grid / packages / react-data-grid / src / __tests__ / Row.spec.js View on Github external
it('should have extra classes', () => {
      const newProps = { ...fakeProps, extraClasses: fakeExtraClasses.join(' ') };
      const component = TestUtils.renderIntoDocument();

      const row = TestUtils.findRenderedDOMComponentWithClass(component, 'react-grid-Row');
      fakeExtraClasses.forEach((c) => {
        const containsExtraClass = row.className.indexOf(c) > -1;
        expect(containsExtraClass).toBe(true);
      });
    });
  });
github negomi / react-burger-menu / test / scaleRotate.spec.js View on Github external
it('has correct item styles', () => {
    component = TestUtils.renderIntoDocument(<menu><div>An item</div></menu>);
    firstItem = TestUtils.findRenderedDOMComponentWithClass(component, 'bm-item-list').children[0];
    expect(firstItem.style.display).to.equal('block');
  });
github negomi / react-burger-menu / test / menuFactory.spec.js View on Github external
it('accepts an optional burgerButtonClassName', () =&gt; {
      component = TestUtils.renderIntoDocument(<menu>);
      const button = TestUtils.findRenderedDOMComponentWithClass(component, 'bm-burger-button');
      expect(button.classList.toString()).to.contain('custom-class');
    });
</menu>
github negomi / react-burger-menu / test / slide.spec.js View on Github external
it('has correct item styles', () => {
    const firstItem = TestUtils.findRenderedDOMComponentWithClass(component, 'bm-item-list').children[0];
    expect(firstItem.style.display).to.equal('block');
  });
github davidkpiano / react-redux-form / test / field-component-spec.js View on Github external
        assert.throws(() => TestUtils.findRenderedDOMComponentWithClass(field, 'focused'));
github Fauntleroy / react-simple-dropdown / test / components / Dropdown.jsx View on Github external
function renderTestApp () {
  const testApp = renderIntoDocument();
  const dropdown = findRenderedComponentWithType(testApp, Dropdown);
  const dropdownElement = findRenderedDOMComponentWithClass(dropdown, 'dropdown');
  const dropdownElementDomNode = findDOMNode(dropdownElement);
  const trigger = findRenderedComponentWithType(testApp, DropdownTrigger);
  const triggerElement = findRenderedDOMComponentWithClass(trigger, 'dropdown__trigger');
  const content = findRenderedComponentWithType(testApp, DropdownContent);
  const contentElement = findRenderedDOMComponentWithClass(content, 'dropdown__content');
  const contentElementDomNode = findDOMNode(contentElement);

  return {
    testApp,
    dropdown,
    dropdownElement,
    dropdownElementDomNode,
    trigger,
    triggerElement,
    content,
    contentElement,
    contentElementDomNode
  };
}
github redux-form / redux-form / src / __tests__ / FormSection.spec.js View on Github external
return (
            
              
            
          )
        }
      }
      const TestForm = reduxForm({ form: 'testForm' })(Form)
      const dom = TestUtils.renderIntoDocument(
        
          
        
      )

      const addButton = TestUtils.findRenderedDOMComponentWithClass(dom, 'add')
      const removeButton = TestUtils.findRenderedDOMComponentWithClass(
        dom,
        'remove'
      )
      TestUtils.Simulate.click(addButton)

      expect(store.getState()).toEqualMap({
        form: {
          testForm: {
            values: {
              foo: {
                bar: ['dog', 'cat', 'fish']
              }
            },
            registeredFields: {
              'foo.bar': { name: 'foo.bar', type: 'FieldArray', count: 1 },
              'foo.bar[0]': { name: 'foo.bar[0]', type: 'Field', count: 1 },
github Foundry376 / Mailspring / app / spec / components / editable-list-spec.jsx View on Github external
it('renders create input as an item when creating', () => {
      const items = ['1', '2', '3'];
      const list = makeList(items, { initialState: { creatingItem: true } });
      const createItem = findRenderedDOMComponentWithClass(list, 'create-item-input');
      expect(createItem).toBeDefined();
    });