How to use the inferno-test-utils.renderIntoContainer function in inferno-test-utils

To help you get started, we’ve selected a few inferno-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 jhsware / inferno-bootstrap / __test__ / Tooltip.TOFIX-spec.jsx View on Github external
it('should toggle isOpen', (done) => {
    const wrapper = renderIntoContainer(
      
      Tooltip Content
      , container
    );
    wrapper.forceUpdate(() => {
      expect(document.getElementsByClassName('tooltip').length).toBe(0);
      setProps(wrapper, { isOpen: true });
      expect(document.getElementsByClassName('tooltip').length).toBe(1);
      setProps(wrapper, { isOpen: false });
      expect(document.getElementsByClassName('tooltip').length).toBe(0);
      done();
    });
    
  });
github jhsware / inferno-bootstrap / __test__ / Tooltip.TOFIX-spec.jsx View on Github external
it('should render with "hideArrow" true when "hideArrow" prop is truthy', () => {
    const wrapper = renderIntoContainer(
      
      Tooltip Content
      , container
    );
    
    expect(wrapper.props['hideArrow']).toBe(true);
  });
github jhsware / inferno-bootstrap / __test__ / Modal / Modal.spec.jsx View on Github external
it('should render with class "modal-dialog" and have custom class name if provided', (done) => {
    isOpen = true;
    const renderedTree = renderIntoContainer(Yo!, container);
    renderedTree.forceUpdate(() => {
      expect(container.innerHTML).toBe('');
      expect(document.getElementsByClassName('my-custom-modal').length).toBe(1);
      expect(document.getElementsByClassName('modal-dialog').length).toBe(1);
      done()
    })
  });
github jhsware / inferno-bootstrap / __test__ / Tooltip.TOFIX-spec.jsx View on Github external
it('should render with target object', (done) => {
    isOpen = true;
    const wrapper = renderIntoContainer(
      
      Tooltip Content
      , container
    );
    wrapper.forceUpdate(() => {
      const tooltips = document.getElementsByClassName('tooltip');
      
      expect(container.querySelector('.tooltip.show')).toBeDefined();
      expect(tooltips.length).toBe(1);
      expect(tooltips[0].textContent).toBe('Tooltip Content');
      done();
    });
    
  });
github jhsware / inferno-bootstrap / __test__ / Tooltip.TOFIX-spec.jsx View on Github external
it('should handle target clicks', () => {
    const wrapper = renderIntoContainer(
      
      Tooltip Content
      , container
    );
    


    expect(isOpen).toBe(false);
    triggerEvent('click', target)
    expect(isOpen).toBe(true);
    triggerEvent('click', target)
    expect(isOpen).toBe(false);
  });
github jhsware / inferno-bootstrap / __test__ / PopperContent.TOFIX-spec.jsx View on Github external
it('should render a Manager as a span by default', () => {
    const renderedTree = renderIntoContainer(Yo!, container);

    const node = findVNodeWithType(renderedTree, Manager)
    expect(node).toBeDefined()
  });
github jhsware / inferno-bootstrap / __test__ / Collapse.spec.jsx View on Github external
it('should have default isOpen value', () => {
    const renderTree = renderIntoContainer();
    expect(renderTree.props.isOpen).toEqual(false);
  });