You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ea...@apache.org on 2020/03/12 13:20:29 UTC

[qpid-dispatch] branch master updated: DISPATCH-1596 Avoid using 'await' in console tests. Use Promise instead.

This is an automated email from the ASF dual-hosted git repository.

eallen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/master by this push:
     new fdf6ecf  DISPATCH-1596 Avoid using 'await' in console tests. Use Promise instead.
fdf6ecf is described below

commit fdf6ecf65ed9a7e6c411c9e6b41f5930cc12a6aa
Author: Ernest Allen <ea...@redhat.com>
AuthorDate: Thu Mar 12 09:20:12 2020 -0400

    DISPATCH-1596 Avoid using 'await' in console tests. Use Promise instead.
---
 console/react/src/chord/chordPage.test.js          |  15 +--
 console/react/src/chord/chordViewer.test.js        |  55 +++++-----
 console/react/src/details/createTablePage.test.js  |  59 ++++++-----
 console/react/src/details/deleteEntity.test.js     |  53 ++++-----
 console/react/src/details/detailsTablePage.test.js |  37 +++----
 console/react/src/details/entitiesPage.test.js     |  47 ++++----
 console/react/src/details/entityList.test.js       |  43 ++++----
 .../src/overview/dashboard/dashboardPage.test.js   |  13 +--
 .../src/overview/dashboard/inflightChart.test.js   |  13 +--
 .../src/overview/dashboard/throughputChart.test.js |  19 ++--
 console/react/src/overview/overviewPage.test.js    |  34 +++---
 console/react/src/serviceTest.js                   |   9 +-
 console/react/src/topology/topologyViewer.test.js  | 118 ++++++++++-----------
 tests/system_tests_console.py                      |   2 +-
 14 files changed, 267 insertions(+), 250 deletions(-)

diff --git a/console/react/src/chord/chordPage.test.js b/console/react/src/chord/chordPage.test.js
index 71c028d..0d6411f 100644
--- a/console/react/src/chord/chordPage.test.js
+++ b/console/react/src/chord/chordPage.test.js
@@ -22,13 +22,14 @@ import { render } from "@testing-library/react";
 import { service, login } from "../serviceTest";
 import ChordPage from "./chordPage";
 
-it("renders the ChordPage", async () => {
-  await login();
-  expect(service.management.connection.is_connected()).toBe(true);
+it("renders the ChordPage", () => {
+  login(() => {
+    expect(service.management.connection.is_connected()).toBe(true);
 
-  const props = {
-    service
-  };
+    const props = {
+      service
+    };
 
-  render(<ChordPage {...props} />);
+    render(<ChordPage {...props} />);
+  });
 });
diff --git a/console/react/src/chord/chordViewer.test.js b/console/react/src/chord/chordViewer.test.js
index 2de8fa0..ab5747b 100644
--- a/console/react/src/chord/chordViewer.test.js
+++ b/console/react/src/chord/chordViewer.test.js
@@ -23,7 +23,7 @@ import { service, login, TEST_PORT } from "../serviceTest";
 import { LocalStorageMock } from "@react-mock/localstorage";
 import ChordViewer from "./chordViewer";
 
-it("renders the ChordViewer component", async () => {
+it("renders the ChordViewer component", () => {
   const props = {
     service
   };
@@ -31,36 +31,37 @@ it("renders the ChordViewer component", async () => {
   if (!TEST_PORT) {
     console.log("using mock service");
   }
-  await login();
-  expect(service.management.connection.is_connected()).toBe(true);
+  login(async () => {
+    expect(service.management.connection.is_connected()).toBe(true);
 
-  const { getByLabelText } = render(
-    <LocalStorageMock
-      items={{
-        chordOptions: JSON.stringify({
-          isRate: false,
-          byAddress: true
-        })
-      }}
-    >
-      <ChordViewer {...props} />
-    </LocalStorageMock>
-  );
+    const { getByLabelText } = render(
+      <LocalStorageMock
+        items={{
+          chordOptions: JSON.stringify({
+            isRate: false,
+            byAddress: true
+          })
+        }}
+      >
+        <ChordViewer {...props} />
+      </LocalStorageMock>
+    );
 
-  // make sure it rendered the component
-  const pfTopologyView = getByLabelText("chord-viewer");
-  expect(pfTopologyView).toBeInTheDocument();
+    // make sure it rendered the component
+    const pfTopologyView = getByLabelText("chord-viewer");
+    expect(pfTopologyView).toBeInTheDocument();
 
-  // make sure it created the svg
-  expect(getByLabelText("chord-svg")).toBeInTheDocument();
+    // make sure it created the svg
+    expect(getByLabelText("chord-svg")).toBeInTheDocument();
 
-  const optionsButton = getByLabelText("button-for-Options");
-  fireEvent.click(optionsButton);
+    const optionsButton = getByLabelText("button-for-Options");
+    fireEvent.click(optionsButton);
 
-  // turn on show by address
-  const addressButton = getByLabelText("show by address");
-  fireEvent.click(addressButton);
+    // turn on show by address
+    const addressButton = getByLabelText("show by address");
+    fireEvent.click(addressButton);
 
-  // after 1 update period, the B chord should be in the svg
-  await waitForElement(() => getByLabelText("B"));
+    // after 1 update period, the B chord should be in the svg
+    await waitForElement(() => getByLabelText("B"));
+  });
 });
diff --git a/console/react/src/details/createTablePage.test.js b/console/react/src/details/createTablePage.test.js
index 28c4a07..bf79491 100644
--- a/console/react/src/details/createTablePage.test.js
+++ b/console/react/src/details/createTablePage.test.js
@@ -22,36 +22,37 @@ import { render, fireEvent, waitForElement } from "@testing-library/react";
 import CreateTablePage from "./createTablePage";
 import { service, login, TEST_PORT } from "../serviceTest";
 
-it("renders a CreateTablePage", async () => {
+it("renders a CreateTablePage", () => {
   if (!TEST_PORT) {
     console.log("using mock service");
   }
-  await login();
-  expect(service.management.connection.is_connected()).toBe(true);
-
-  const listenerName = "testListener";
-  const props = {
-    entity: "listener",
-    service,
-    schema: service.schema,
-    locationState: {},
-    routerId: Object.keys(service.management.topology._nodeInfo)[0],
-    handleAddNotification: () => {},
-    handleActionCancel: () => {}
-  };
-  const { getByLabelText, getByText } = render(<CreateTablePage {...props} />);
-
-  // the create form should be present
-  const createForm = getByLabelText("create-entity-form");
-  expect(createForm).toBeInTheDocument();
-
-  // add a listener name
-  fireEvent.change(getByLabelText(/name/i), { target: { value: listenerName } });
-
-  // there should be a create button
-  const createButton = getByText("Create");
-  expect(createButton).toBeInTheDocument();
-
-  // clicking the create button should submit the method
-  fireEvent.click(createButton);
+  login(() => {
+    expect(service.management.connection.is_connected()).toBe(true);
+
+    const listenerName = "testListener";
+    const props = {
+      entity: "listener",
+      service,
+      schema: service.schema,
+      locationState: {},
+      routerId: Object.keys(service.management.topology._nodeInfo)[0],
+      handleAddNotification: () => {},
+      handleActionCancel: () => {}
+    };
+    const { getByLabelText, getByText } = render(<CreateTablePage {...props} />);
+
+    // the create form should be present
+    const createForm = getByLabelText("create-entity-form");
+    expect(createForm).toBeInTheDocument();
+
+    // add a listener name
+    fireEvent.change(getByLabelText(/name/i), { target: { value: listenerName } });
+
+    // there should be a create button
+    const createButton = getByText("Create");
+    expect(createButton).toBeInTheDocument();
+
+    // clicking the create button should submit the method
+    fireEvent.click(createButton);
+  });
 });
diff --git a/console/react/src/details/deleteEntity.test.js b/console/react/src/details/deleteEntity.test.js
index 48356c1..2f54ca4 100644
--- a/console/react/src/details/deleteEntity.test.js
+++ b/console/react/src/details/deleteEntity.test.js
@@ -22,34 +22,35 @@ import { render, fireEvent } from "@testing-library/react";
 import { service, login } from "../serviceTest";
 import DeleteEntity from "./deleteEntity";
 
-it("renders DeleteEntity", async () => {
+it("renders DeleteEntity", () => {
   const entity = "listener";
   const routerName = "A";
   const recordName = "testListener";
 
-  await login();
-  expect(service.management.connection.is_connected()).toBe(true);
-
-  const props = {
-    entity,
-    service,
-    record: {
-      name: recordName,
-      routerId: service.utilities.idFromName(routerName, "_topo"),
-      identity: `${entity}/:amqp:${recordName}`
-    },
-    handleAddNotification: () => {}
-  };
-
-  const { getByLabelText } = render(<DeleteEntity {...props} />);
-  const button = getByLabelText("delete-entity-button");
-  expect(button).toBeInTheDocument();
-
-  // so the delete confirmation popup
-  fireEvent.click(button);
-  const confirmButton = getByLabelText("confirm-delete");
-  expect(confirmButton).toBeInTheDocument();
-
-  // try to delete
-  fireEvent.click(confirmButton);
+  login(() => {
+    expect(service.management.connection.is_connected()).toBe(true);
+
+    const props = {
+      entity,
+      service,
+      record: {
+        name: recordName,
+        routerId: service.utilities.idFromName(routerName, "_topo"),
+        identity: `${entity}/:amqp:${recordName}`
+      },
+      handleAddNotification: () => {}
+    };
+
+    const { getByLabelText } = render(<DeleteEntity {...props} />);
+    const button = getByLabelText("delete-entity-button");
+    expect(button).toBeInTheDocument();
+
+    // so the delete confirmation popup
+    fireEvent.click(button);
+    const confirmButton = getByLabelText("confirm-delete");
+    expect(confirmButton).toBeInTheDocument();
+
+    // try to delete
+    fireEvent.click(confirmButton);
+  });
 });
diff --git a/console/react/src/details/detailsTablePage.test.js b/console/react/src/details/detailsTablePage.test.js
index 53b927b..a374e97 100644
--- a/console/react/src/details/detailsTablePage.test.js
+++ b/console/react/src/details/detailsTablePage.test.js
@@ -22,27 +22,28 @@ import { render } from "@testing-library/react";
 import { service, login } from "../serviceTest";
 import DetailTablesPage from "./detailsTablePage";
 
-it("renders the DetailTablesPage", async () => {
+it("renders the DetailTablesPage", () => {
   const entity = "router";
   const routerName = "A";
 
-  await login();
-  expect(service.management.connection.is_connected()).toBe(true);
+  login(() => {
+    expect(service.management.connection.is_connected()).toBe(true);
 
-  const props = {
-    entity,
-    locationState: {
-      currentRecord: {
-        name: routerName,
-        routerId: service.utilities.idFromName(routerName, "_topo")
-      }
-    },
-    details: true,
-    service,
-    schema: service.schema
-  };
+    const props = {
+      entity,
+      locationState: {
+        currentRecord: {
+          name: routerName,
+          routerId: service.utilities.idFromName(routerName, "_topo")
+        }
+      },
+      details: true,
+      service,
+      schema: service.schema
+    };
 
-  const { getByTestId } = render(<DetailTablesPage {...props} />);
-  const header = getByTestId(`detail-for-${routerName}`);
-  expect(header).toBeInTheDocument();
+    const { getByTestId } = render(<DetailTablesPage {...props} />);
+    const header = getByTestId(`detail-for-${routerName}`);
+    expect(header).toBeInTheDocument();
+  });
 });
diff --git a/console/react/src/details/entitiesPage.test.js b/console/react/src/details/entitiesPage.test.js
index 8b5e012..13e7048 100644
--- a/console/react/src/details/entitiesPage.test.js
+++ b/console/react/src/details/entitiesPage.test.js
@@ -22,29 +22,32 @@ import { render, waitForElement, fireEvent } from "@testing-library/react";
 import { service, login, TEST_PORT } from "../serviceTest";
 import EntitiesPage from "./entitiesPage";
 
-it("renders an EntitiesPage", async () => {
+it("renders an EntitiesPage", () => {
   if (!TEST_PORT) {
     console.log("using mock service");
   }
-  await login();
-  expect(service.management.connection.is_connected()).toBe(true);
-
-  const props = {
-    service,
-    schema: service.schema
-  };
-  let pageRef = null;
-  const { getByTestId } = render(<EntitiesPage ref={el => (pageRef = el)} {...props} />);
-
-  // force page to show the router entity list
-  pageRef.handleSelectEntity("router");
-
-  // the router A should be in the list
-  await waitForElement(() => getByTestId("A"));
-
-  // click on the A
-  fireEvent.click(getByTestId("A"));
-
-  // the details page should show for router A
-  await waitForElement(() => getByTestId("detail-for-A"));
+  login(async () => {
+    expect(service.management.connection.is_connected()).toBe(true);
+
+    const props = {
+      service,
+      schema: service.schema
+    };
+    let pageRef = null;
+    const { getByTestId } = render(
+      <EntitiesPage ref={el => (pageRef = el)} {...props} />
+    );
+
+    // force page to show the router entity list
+    pageRef.handleSelectEntity("router");
+
+    // the router A should be in the list
+    await waitForElement(() => getByTestId("A"));
+
+    // click on the A
+    fireEvent.click(getByTestId("A"));
+
+    // the details page should show for router A
+    await waitForElement(() => getByTestId("detail-for-A"));
+  });
 });
diff --git a/console/react/src/details/entityList.test.js b/console/react/src/details/entityList.test.js
index d86d4c7..35aa535 100644
--- a/console/react/src/details/entityList.test.js
+++ b/console/react/src/details/entityList.test.js
@@ -22,28 +22,29 @@ import { render, fireEvent } from "@testing-library/react";
 import { service, login, TEST_PORT } from "../serviceTest";
 import EntityList from "./entityList";
 
-it("renders a EntityList", async () => {
+it("renders a EntityList", () => {
   if (!TEST_PORT) {
     console.log("using mock service");
   }
-  await login();
-  expect(service.management.connection.is_connected()).toBe(true);
-
-  const props = {
-    service,
-    schema: service.schema,
-    handleSelectEntity: () => {}
-  };
-  const { getByTestId } = render(<EntityList {...props} />);
-
-  // the log item should be there
-  const logEntity = getByTestId("log");
-  expect(logEntity).toBeInTheDocument();
-
-  // clicking on the log entity should not crash
-  fireEvent.click(logEntity);
-
-  fireEvent.click(getByTestId("router"));
-  fireEvent.click(getByTestId("autoLink"));
-  fireEvent.click(getByTestId("connection"));
+  login(() => {
+    expect(service.management.connection.is_connected()).toBe(true);
+
+    const props = {
+      service,
+      schema: service.schema,
+      handleSelectEntity: () => {}
+    };
+    const { getByTestId } = render(<EntityList {...props} />);
+
+    // the log item should be there
+    const logEntity = getByTestId("log");
+    expect(logEntity).toBeInTheDocument();
+
+    // clicking on the log entity should not crash
+    fireEvent.click(logEntity);
+
+    fireEvent.click(getByTestId("router"));
+    fireEvent.click(getByTestId("autoLink"));
+    fireEvent.click(getByTestId("connection"));
+  });
 });
diff --git a/console/react/src/overview/dashboard/dashboardPage.test.js b/console/react/src/overview/dashboard/dashboardPage.test.js
index 535ae9f..cba605f 100644
--- a/console/react/src/overview/dashboard/dashboardPage.test.js
+++ b/console/react/src/overview/dashboard/dashboardPage.test.js
@@ -24,7 +24,7 @@ import throughputChartData from "./throughputData";
 import inflightChartData from "./inflightData";
 import DashboardPage from "./dashboardPage";
 
-it("renders the DashboardPage component", async () => {
+it("renders the DashboardPage component", () => {
   const props = {
     service,
     throughputChartData: new throughputChartData(service),
@@ -32,11 +32,12 @@ it("renders the DashboardPage component", async () => {
   };
 
   if (!TEST_PORT) console.log("using mock service");
-  await login();
-  expect(service.management.connection.is_connected()).toBe(true);
+  login(() => {
+    expect(service.management.connection.is_connected()).toBe(true);
 
-  const { getByLabelText } = render(<DashboardPage {...props} />);
+    const { getByLabelText } = render(<DashboardPage {...props} />);
 
-  // make sure it rendered the component
-  expect(getByLabelText("dashboard-page")).toBeInTheDocument();
+    // make sure it rendered the component
+    expect(getByLabelText("dashboard-page")).toBeInTheDocument();
+  });
 });
diff --git a/console/react/src/overview/dashboard/inflightChart.test.js b/console/react/src/overview/dashboard/inflightChart.test.js
index d90e5c3..a9f319a 100644
--- a/console/react/src/overview/dashboard/inflightChart.test.js
+++ b/console/react/src/overview/dashboard/inflightChart.test.js
@@ -23,18 +23,19 @@ import { service, login, TEST_PORT } from "../../serviceTest";
 import InflightChart from "./inflightChart";
 import InflightChartData from "./inflightData";
 
-it("renders the InflightChart component", async () => {
+it("renders the InflightChart component", () => {
   const props = {
     service,
     chartData: new InflightChartData(service)
   };
 
   if (!TEST_PORT) console.log("using mock service");
-  await login();
-  expect(service.management.connection.is_connected()).toBe(true);
+  login(() => {
+    expect(service.management.connection.is_connected()).toBe(true);
 
-  const { getByLabelText } = render(<InflightChart {...props} />);
+    const { getByLabelText } = render(<InflightChart {...props} />);
 
-  // make sure it rendered the component
-  setTimeout(() => expect(getByLabelText("inflight-chart")).toBeInTheDocument(), 1);
+    // make sure it rendered the component
+    setTimeout(() => expect(getByLabelText("inflight-chart")).toBeInTheDocument(), 1);
+  });
 });
diff --git a/console/react/src/overview/dashboard/throughputChart.test.js b/console/react/src/overview/dashboard/throughputChart.test.js
index 2d0c41d..dc3e75b 100644
--- a/console/react/src/overview/dashboard/throughputChart.test.js
+++ b/console/react/src/overview/dashboard/throughputChart.test.js
@@ -23,22 +23,23 @@ import { service, login, TEST_PORT } from "../../serviceTest";
 import ThroughputChartData from "./throughputData";
 import ThroughputChart from "./throughputChart";
 
-it("renders the ThroughputChart component", async () => {
+it("renders the ThroughputChart component", () => {
   const props = {
     service,
     chartData: new ThroughputChartData(service)
   };
 
   if (!TEST_PORT) console.log("using mock service");
-  await login();
-  expect(service.management.connection.is_connected()).toBe(true);
+  login(() => {
+    expect(service.management.connection.is_connected()).toBe(true);
 
-  const { getByLabelText, queryByLabelText } = render(<ThroughputChart {...props} />);
+    const { getByLabelText, queryByLabelText } = render(<ThroughputChart {...props} />);
 
-  // the component should initially render
-  // blank until it gets the contianer's width.
-  expect(queryByLabelText("throughput-chart")).toBe(null);
+    // the component should initially render
+    // blank until it gets the contianer's width.
+    expect(queryByLabelText("throughput-chart")).toBe(null);
 
-  // yeild, so that this componentDidMount method can fire
-  setTimeout(() => expect(getByLabelText("throughput-chart")).toBeInTheDocument(), 1);
+    // yeild, so that this componentDidMount method can fire
+    setTimeout(() => expect(getByLabelText("throughput-chart")).toBeInTheDocument(), 1);
+  });
 });
diff --git a/console/react/src/overview/overviewPage.test.js b/console/react/src/overview/overviewPage.test.js
index bc2d0e8..9b71fba 100644
--- a/console/react/src/overview/overviewPage.test.js
+++ b/console/react/src/overview/overviewPage.test.js
@@ -19,27 +19,23 @@ under the License.
 
 import React from "react";
 import { render } from "@testing-library/react";
-import { service, login, TEST_PORT } from "../serviceTest";
+import { service, login } from "../serviceTest";
 import OverviewPage from "./overviewPage";
 
-it("renders the overview connections page", async () => {
-  const entity = "connections";
+it("renders the overview logs page", () => {
+  const entity = "logs";
   const props = {
     service,
     location: { pathname: `/overview/${entity}` },
     lastUpdated: () => {}
   };
 
-  if (!TEST_PORT) console.log("using mock service");
-  await login();
-  expect(service.management.connection.is_connected()).toBe(true);
-
   const { getByLabelText } = render(<OverviewPage {...props} />);
   expect(getByLabelText(entity)).toBeInTheDocument();
 });
 
-it("renders the overview logs page", async () => {
-  const entity = "logs";
+it("renders the overview links page", () => {
+  const entity = "links";
   const props = {
     service,
     location: { pathname: `/overview/${entity}` },
@@ -50,8 +46,8 @@ it("renders the overview logs page", async () => {
   expect(getByLabelText(entity)).toBeInTheDocument();
 });
 
-it("renders the overview links page", async () => {
-  const entity = "links";
+it("renders the overview routers page", () => {
+  const entity = "routers";
   const props = {
     service,
     location: { pathname: `/overview/${entity}` },
@@ -62,8 +58,8 @@ it("renders the overview links page", async () => {
   expect(getByLabelText(entity)).toBeInTheDocument();
 });
 
-it("renders the overview routers page", async () => {
-  const entity = "routers";
+it("renders the overview addresses page", () => {
+  const entity = "addresses";
   const props = {
     service,
     location: { pathname: `/overview/${entity}` },
@@ -74,14 +70,18 @@ it("renders the overview routers page", async () => {
   expect(getByLabelText(entity)).toBeInTheDocument();
 });
 
-it("renders the overview addresses page", async () => {
-  const entity = "addresses";
+it("renders the overview connections page", () => {
+  const entity = "connections";
   const props = {
     service,
     location: { pathname: `/overview/${entity}` },
     lastUpdated: () => {}
   };
 
-  const { getByLabelText } = render(<OverviewPage {...props} />);
-  expect(getByLabelText(entity)).toBeInTheDocument();
+  login(() => {
+    expect(service.management.connection.is_connected()).toBe(true);
+
+    const { getByLabelText } = render(<OverviewPage {...props} />);
+    expect(getByLabelText(entity)).toBeInTheDocument();
+  });
 });
diff --git a/console/react/src/serviceTest.js b/console/react/src/serviceTest.js
index ef14533..5ff1b19 100644
--- a/console/react/src/serviceTest.js
+++ b/console/react/src/serviceTest.js
@@ -23,6 +23,11 @@ import { QDRService } from "./common/qdrService";
 const TEST_PORT = process.env.TEST_PORT;
 const service = TEST_PORT ? new QDRService() : mockService({});
 
-const login = () =>
-  service.connect({ address: "localhost", port: TEST_PORT, reconnect: false });
+const login = callback =>
+  service
+    .connect({ address: "localhost", port: TEST_PORT, reconnect: false })
+    .then(() => {
+      if (callback) callback();
+    });
+
 export { service, TEST_PORT, login };
diff --git a/console/react/src/topology/topologyViewer.test.js b/console/react/src/topology/topologyViewer.test.js
index ed60419..72d2a6d 100644
--- a/console/react/src/topology/topologyViewer.test.js
+++ b/console/react/src/topology/topologyViewer.test.js
@@ -23,7 +23,7 @@ import { service, login } from "../serviceTest";
 import TopologyViewer from "./topologyViewer";
 import * as world from "../../public/data/countries.json";
 
-it("renders the TopologyViewer component", async () => {
+it("renders the TopologyViewer component", () => {
   jest.spyOn(window, "fetch").mockImplementationOnce(() => {
     return Promise.resolve({
       json: () => Promise.resolve(world)
@@ -34,62 +34,62 @@ it("renders the TopologyViewer component", async () => {
     handleAddNotification: () => {}
   };
 
-  await login();
-
-  const { getByLabelText, getByText, getByTestId } = render(
-    <TopologyViewer {...props} />
-  );
-
-  // make sure it rendered the component
-  const pfTopologyView = getByLabelText("topology-viewer");
-  expect(pfTopologyView).toBeInTheDocument();
-  expect(getByLabelText("topology-diagram")).toBeInTheDocument();
-
-  // make sure it created the svg
-  await waitForElement(() => getByLabelText("topology-svg"));
-
-  // the svg should have a router circle
-  await waitForElement(() => getByTestId("router-0"));
-
-  // "click" on the router
-  const router = getByTestId("router-0");
-  fireEvent.mouseDown(router);
-  fireEvent.mouseUp(router);
-
-  // the routerInfo modal appears
-  await waitForElement(() => getByLabelText("Close"));
-  // close the modal
-  fireEvent.click(getByLabelText("Close"));
-
-  // the svg should have a client circle
-  const client = getByTestId("client-2");
-  // "click" on the client
-  fireEvent.mouseDown(client);
-  fireEvent.mouseUp(client);
-
-  // the clientInfo modal appears
-  await waitForElement(() => getByLabelText("Close"));
-  // close the modal
-  fireEvent.click(getByLabelText("Close"));
-
-  // make sure the legend opens
-  const legendButton = getByText("topology-legend");
-  expect(legendButton).toBeInTheDocument();
-  fireEvent.click(legendButton);
-  fireEvent.click(getByLabelText("Close"));
-
-  // turn on the traffic animation
-
-  // dropdown the traffic panel
-  fireEvent.contextMenu(client);
-  fireEvent.click(pfTopologyView);
-  const trafficButton = getByLabelText("button-for-Traffic");
-  expect(trafficButton).toBeInTheDocument();
-  fireEvent.click(trafficButton);
-
-  // click on the show traffic checkbox
-  const trafficCheckbox = getByLabelText("show traffic by address");
-  fireEvent.click(trafficCheckbox);
-  // the address dot should be there
-  await waitForElement(() => getByText("toB"));
+  login(async () => {
+    const { getByLabelText, getByText, getByTestId } = render(
+      <TopologyViewer {...props} />
+    );
+
+    // make sure it rendered the component
+    const pfTopologyView = getByLabelText("topology-viewer");
+    expect(pfTopologyView).toBeInTheDocument();
+    expect(getByLabelText("topology-diagram")).toBeInTheDocument();
+
+    // make sure it created the svg
+    await waitForElement(() => getByLabelText("topology-svg"));
+
+    // the svg should have a router circle
+    await waitForElement(() => getByTestId("router-0"));
+
+    // "click" on the router
+    const router = getByTestId("router-0");
+    fireEvent.mouseDown(router);
+    fireEvent.mouseUp(router);
+
+    // the routerInfo modal appears
+    await waitForElement(() => getByLabelText("Close"));
+    // close the modal
+    fireEvent.click(getByLabelText("Close"));
+
+    // the svg should have a client circle
+    const client = getByTestId("client-2");
+    // "click" on the client
+    fireEvent.mouseDown(client);
+    fireEvent.mouseUp(client);
+
+    // the clientInfo modal appears
+    await waitForElement(() => getByLabelText("Close"));
+    // close the modal
+    fireEvent.click(getByLabelText("Close"));
+
+    // make sure the legend opens
+    const legendButton = getByText("topology-legend");
+    expect(legendButton).toBeInTheDocument();
+    fireEvent.click(legendButton);
+    fireEvent.click(getByLabelText("Close"));
+
+    // turn on the traffic animation
+
+    // dropdown the traffic panel
+    fireEvent.contextMenu(client);
+    fireEvent.click(pfTopologyView);
+    const trafficButton = getByLabelText("button-for-Traffic");
+    expect(trafficButton).toBeInTheDocument();
+    fireEvent.click(trafficButton);
+
+    // click on the show traffic checkbox
+    const trafficCheckbox = getByLabelText("show traffic by address");
+    fireEvent.click(trafficCheckbox);
+    // the address dot should be there
+    await waitForElement(() => getByText("toB"));
+  });
 });
diff --git a/tests/system_tests_console.py b/tests/system_tests_console.py
index df744d0..4e2bda2 100644
--- a/tests/system_tests_console.py
+++ b/tests/system_tests_console.py
@@ -116,7 +116,7 @@ class ConsoleTest(TestCase):
         pret = 0
 
         out = ''
-        prg = ['npm',  'test', '--', '--watchAll=false', '--coverage']
+        prg = ['npm',  'test', '--', '--watchAll=false']
 
         p = self.popen(prg, 
             cwd=os.path.join(os.environ.get('BUILD_DIR'), 'console'),


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org