コード例 #1
0
 it('shows n/a when node was not found', () => {
   const c = TestUtils.renderIntoDocument(
     <Provider store={configureStore()}>
       <NodeDetails notFound />
     </Provider>
   );
   const notFound = TestUtils.findRenderedDOMComponentWithClass(c,
     'node-details-header-notavailable');
   expect(notFound).toBeDefined();
 });
コード例 #2
0
  it('show label of node with title', () => {
    nodes = nodes.set(nodeId, Immutable.fromJS({id: nodeId}));
    details = {label: 'Node 1'};
    const c = TestUtils.renderIntoDocument(
      <Provider store={configureStore()}>
        <NodeDetails
          nodes={nodes}
          topologyId="containers"
          nodeId={nodeId} details={details}
        />
      </Provider>
    );

    const title = TestUtils.findRenderedDOMComponentWithClass(c, 'node-details-header-label');
    expect(title.title).toBe('Node 1');
  });