How to use inferno-test-utils - 10 common examples

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 bpmn-io / table-js / test / spec / render / components / TableComponentSpec.js View on Github external
it('should render before table', inject(function(components, injector) {

    // given
    components.onGetComponent('table.before', () =&gt; () =&gt; <div></div>);

    // when
    const renderedTree = renderIntoDocument();

    // then
    expect(findRenderedDOMElementWithClass(renderedTree, 'before')).to.exist;
  }));
github bpmn-io / table-js / test / spec / render / components / TableComponentSpec.js View on Github external
it('should render after table', inject(function(components, injector) {

    // given
    components.onGetComponent('table.after', () =&gt; () =&gt; <div></div>);

    // when
    const renderedTree = renderIntoDocument();

    // then
    expect(findRenderedDOMElementWithClass(renderedTree, 'after')).to.exist;
  }));
github bpmn-io / table-js / test / spec / render / components / TableComponentSpec.js View on Github external
it('should render table', inject(function(injector) {

    // when
    const renderedTree = renderIntoDocument();

    // then
    const node = findRenderedDOMElementWithClass(renderedTree, 'tjs-table');

    expect(node).to.exist;
  }));
github bpmn-io / table-js / test / spec / features / context-menu / components / ContextMenuComponentSpec.js View on Github external
it('unless autoFocus=false', inject(function(contextMenu) {

        // when
        contextMenu.open(null, {
          autoFocus: false
        });

        // then
        var inputEl = findRenderedDOMElementWithClass(renderedTree, 'test-input');

        expect(
          document.activeElement
        ).not.to.equal(inputEl);
      }));
github bpmn-io / table-js / test / spec / render / components / TableComponentSpec.js View on Github external
it('should render head, body &amp; foot', inject(function(components, injector) {

    // given
    components.onGetComponent('table.head', () =&gt; () =&gt; );
    components.onGetComponent('table.body', () =&gt; () =&gt; );
    components.onGetComponent('table.foot', () =&gt; () =&gt; );

    // when
    const renderedTree = renderIntoDocument();

    // then
    expect(findRenderedDOMElementWithClass(renderedTree, 'head')).to.exist;
    expect(findRenderedDOMElementWithClass(renderedTree, 'body')).to.exist;
    expect(findRenderedDOMElementWithClass(renderedTree, 'foot')).to.exist;
  }));
github jhsware / inferno-bootstrap / __test__ / PopperContent.TOFIX-spec.jsx View on Github external
it('should render a PopperTargetHelper', () =&gt; {
    const renderedTree = renderIntoContainer(Yo!, container);

    // expect(wrapper.containsMatchingElement()).toBe(true);
    expect(findVNodeWithType(renderedTree, PopperTargetHelper)).toBeDefined();
    
  });
github bpmn-io / table-js / test / spec / features / context-menu / components / ContextMenuComponentSpec.js View on Github external
// given
      const WithContext = withContext(ContextMenuComponent, {
        injector,
        eventBus
      });

      const renderedTree = renderIntoDocument();

      components.onGetComponent('context-menu', () =&gt; () =&gt; <div></div>);

      // when
      contextMenu.open();

      // then
      expect(findRenderedDOMElementWithClass(renderedTree, 'context-menu')).to.exist;
      expect(findRenderedDOMElementWithClass(renderedTree, 'foo')).to.exist;
    }
  ));
github bpmn-io / table-js / test / spec / features / context-menu / components / ContextMenuComponentSpec.js View on Github external
function(contextMenu) {

        // given
        contextMenu.open();
        const element = findRenderedDOMElementWithClass(renderedTree, 'context-menu');

        // when
        triggerMouseEvent(element, 'mousedown');
        triggerMouseEvent(document.body, 'mouseup');
        triggerMouseEvent(document.body, 'click');

        // then
        expect(
          findRenderedDOMElementWithClass(renderedTree, 'context-menu')
        ).to.exist;
      })
    );
github bpmn-io / table-js / test / spec / components / CellSpec.js View on Github external
);
    }

    const injector = createInjector({
      eventBus: new EventBus()
    });

    // when
    const tree = mount(
      
        
      
    );

    // then
    const node = findRenderedDOMElementWithClass(tree, 'cell');

    expect(node).to.exist;
    expect(node.autofocus).to.be.true;

    expect(matches(node, '.selected')).to.be.false;

    // node selection changed
    injector.get('eventBus').fire('selection.foo.changed', { selected: true });

    expect(matches(node, '.selected')).to.be.true;
    expect(matches(node, '.selected-secondary')).to.be.false;

    injector.get('eventBus').fire('selection.foo.changed', {
      selected: false,
      selectedSecondary: true
    });
github bpmn-io / table-js / test / spec / features / context-menu / components / ContextMenuComponentSpec.js View on Github external
const WithContext = withContext(ContextMenuComponent, {
        injector,
        eventBus
      });

      const renderedTree = renderIntoDocument();

      components.onGetComponent('context-menu', () =&gt; () =&gt; <div></div>);

      contextMenu.open();

      // when
      contextMenu.close();

      // then
      const node = findRenderedDOMElementWithClass(renderedTree, 'context-menu');

      expect(node).to.not.exist;
    }
  ));