How to use the react-addons-test-utils.isCompositeComponent 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 Lobos / react-ui / test / components / Common / basic.js View on Github external
it('Should exist as a React Component', () => {
    const button1 = shallow(<button>
                              Button
                            </button>)
    assert.ok(ReactTestUtils.isCompositeComponent(button1, Button))
  // TODO the rest of components
  })
})
github t7 / react-generated-style-guide / __tests__ / test_fieldset_info.js View on Github external
it('exists in the page', function () {
    expect(T.isCompositeComponent(el)).toBe(true)
  })
github react-melon / melon / test / components / calendar / Day.spec.js View on Github external
it('shouldComponentUpdate', () =&gt; {
        const component = TestUtils.renderIntoDocument();
        expect(TestUtils.isCompositeComponent(component)).toBe(true);
        expect(component.shouldComponentUpdate({date: new Date()})).toBe(false);
        expect(component.shouldComponentUpdate({selected: true})).toBe(true);
        expect(component.shouldComponentUpdate({disabled: true})).toBe(true);
    });
github t7 / react-generated-style-guide / __tests__ / test_fieldset.js View on Github external
it('exists in the page', function () {
    expect(T.isCompositeComponent(el)).toBe(true)
  })
github t7 / react-generated-style-guide / __tests__ / test_accordion_multi.js View on Github external
it('exists in the page', function () {
    expect(T.isCompositeComponent(el)).toBe(true)
  })
github react-melon / melon / test / components / calendar / Month.spec.js View on Github external
it('dom', () =&gt; {

        component = TestUtils.renderIntoDocument(
            
        );

        expect(TestUtils.isCompositeComponent(component)).toBe(true);

        const weekheader = TestUtils.findRenderedDOMComponentWithClass(component, 'ui-calendar-month-weekheader');
        expect(weekheader.childNodes.length).toBe(7);

        const main = TestUtils.findRenderedDOMComponentWithTag(component, 'ul');
        expect(main.childNodes.length).toBe(6);

        const days = TestUtils.scryRenderedComponentsWithType(component, CalendarDay);
        expect(days.length).toBe(42);

        const daysInMonth = days.reduce((result, day) =&gt; {

            let variants = day.props.variants;

            if (variants) {
                result[variants === 'next-month' ? 'next' : 'pre'].push(day);
github react-melon / melon / test / components / Calendar.spec.js View on Github external
it('onDateChange', done => {

            const date = new Date(2014, 5, 12);

            const panel = TestUtils.findRenderedComponentWithType(calendar, CalendarPanel);

            expect(TestUtils.isCompositeComponent(panel)).toBe(true);

            panel.onDateChange({date});

            then(() => {
                expect(calendar.state.date.getDate()).toBe(12);
                expect(calendar.state.date.getMonth()).toBe(5);
                expect(calendar.state.date.getFullYear()).toBe(2014);
                done();
            });

        });
github t7 / react-generated-style-guide / __tests__ / test_form_radio_list_inline.js View on Github external
it('exists in the page', function () {
    expect(T.isCompositeComponent(el)).toBe(true)
  })
github salesforce-ux / design-system / ui / components / modals / index.react.spec.jsx View on Github external
it('is a component', () => {
      expect(isCompositeComponent(cmp)).to.be.true;
    });
    it('has a __node', () => {
github romseguy / react2tree / src / index.js View on Github external
export default function react2tree(app, name = 'tree') {
  const tree = {
    name,
    children: []
  };

  if (!isCompositeComponent(app)) {
    return tree;
  }

  /*eslint-disable*/
  traverse(app, tree);
  /*eslint-enable*/

  function traverse(c, node) {
    if (!c || isDOMComponent(c)) {
      return;
    }

    const newNodeName = typeof c === 'function' ? c.name : c.constructor.name;

    node.children.push({
      name: newNodeName,