How to use the react-addons-test-utils.renderIntoDocument 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 SEL-Columbia / dokomoforms / tests / js / base-component-tests.js View on Github external
it('validates non-numeric values in integer field', () => {


        var ResponseFieldInstance = TestUtils.renderIntoDocument(
            
        );

        var input = TestUtils.findRenderedDOMComponentWithTag(ResponseFieldInstance, 'input');

        // simulate changing input
        TestUtils.Simulate.change(
            input,
            {
                target: {
                    setCustomValidity: setCustomValidity,
                    value: 'a'
                }
            }
        );
github mozilla / addons-frontend / tests / unit / ui / components / TestSearchInput.js View on Github external
it('uses the initial value for the left offset', () => {
    // Test elements don't actually get rendered so all of the offsets are 0.
    const root = renderIntoDocument();
    root.animateLeft = 100;
    root.setIconPosition();
    expect(root.animateIcon.style.transform).toEqual('translateX(-100px)');
  });
github ivantsov / yandex-mail-notifier-firefox / src / panel / __tests__ / components / hover-menu.js View on Github external
it('onClick', () => {
        const component = TestUtils.renderIntoDocument(
            <div>
                
            </div>
        );
        const buttons = component.querySelectorAll('.hover-menu__item');

        [...buttons].forEach((item, index) =&gt; {
            TestUtils.Simulate.click(item);

            expect(baseProps.onUpdateMessageStatus).toBeCalledWith({
                id: baseProps.id,
                oper: actionNames[index]
            });
        });
    });
});
github yyssc / ssc-grid / test / FormSpec.js View on Github external
it('隐藏提交按钮', () =&gt; {
    let mockColumnsModel;
    let mockDefaultData;

    mockColumnsModel = [
      {type: 'string', id: 'name', label: '名称'},
      {type: 'string', id: 'code', label: '编码'}
    ];
    mockDefaultData = { id: '0', name: 'n1', code: 'c1' };
    const component = ReactTestUtils.renderIntoDocument(
      <form>
    );
    const component2 = ReactTestUtils.renderIntoDocument(
      
    );
    const component3 = ReactTestUtils.renderIntoDocument(
      </form>
github Quartz / Chartbuilder / test / jsx / chart-grid-xy.jsx View on Github external
test("Renderer: Chart grid XY", function(t) {
	//t.plan(6);

	var rw = TU.renderIntoDocument(
		
	);

	var svg = TU.findRenderedDOMComponentWithTag(
		rw,
		"svg"
	);

	t.ok(TU.isDOMComponent(svg), "svg rendered to DOM");
github galkinrost / react-ingrid / test / Item.spec.js View on Github external
it(`should have correct size`, () =&gt; {
            const props = {
                ItemComponent: ItemComponentMock,
                itemWidth: rndoam.number(),
                itemHeight: rndoam.number()
            }

            const tree = TestUtils.renderIntoDocument(
                
            )

            const divs = TestUtils.scryRenderedDOMComponentsWithTag(tree, `div`)

            expect(divs[0].style.width).toEqual(`${props.itemWidth}px`)
            expect(divs[0].style.height).toEqual(`${props.itemHeight}px`)
        })
github keen / explorer / test / unit / components / common / notice_spec.js View on Github external
it('it has the right class for anything other than error', function () {
        notice = {
          type: 'success',
          text: 'Some text',
          icon: 'search'
        };
        component = TestUtils.renderIntoDocument();
        assert.lengthOf(TestUtils.scryRenderedDOMComponentsWithClass(component, 'icon'), 1);
        assert.match(TestUtils.findRenderedDOMComponentWithClass(component, 'icon').className, '-search');
      });
    });
github spotify / reactochart / test-enzyme / spec / resolveXYScales.spec.js View on Github external
it('infers margin from children margin props', () =&gt; {
    const props = {
      width, height,
      scaleType: {x: 'linear', y: 'linear'},
      domain: {x: [-50, 50], y: [-100, 100]}
    };
    const tree = 
      
      
    ;
    const wrapped = TestUtils.renderIntoDocument(tree);
    const rendered = TestUtils.findRenderedComponentWithType(wrapped, ContainerChart);
    expectXYScaledComponent(rendered, {margin: {top: 20, bottom: 40, left: 30, right: 50}, ...props});
  });
github jxnblk / reflexbox / test / Flex.spec.js View on Github external
beforeEach(() =&gt; {
          root = TestUtils.renderIntoDocument(
            
              
            
          )
          flex = TestUtils.findRenderedDOMComponentWithClass(root, 'Flex')
          computed = flex.style
        })
github KleeGroup / focus-components / src / components / input / date / __tests__ / index.js View on Github external
beforeEach(done =&gt; {
            renderedTest = TestUtils.renderIntoDocument();
            renderedTest.setState({ value: past }, done);
        });