Skip to content

Commit

Permalink
feat(*): connect to MesosStream on all pages
Browse files Browse the repository at this point in the history
Closes DCOS-37791
  • Loading branch information
nLight committed Jun 6, 2018
1 parent 1cf805e commit 3298195
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
11 changes: 11 additions & 0 deletions src/js/pages/Index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import ConfigStore from "../stores/ConfigStore";
import EventTypes from "../constants/EventTypes";
import InternalStorageMixin from "../mixins/InternalStorageMixin";
import MetadataStore from "../stores/MetadataStore";
import MesosStateStore from "../stores/MesosStateStore";
import Modals from "../components/Modals";
import RequestErrorMsg from "../components/RequestErrorMsg";
import ServerErrorModal from "../components/ServerErrorModal";
Expand Down Expand Up @@ -40,6 +41,10 @@ var Index = React.createClass({
componentWillMount() {
MetadataStore.init();
SidebarStore.init();
MesosStateStore.addChangeListener(
EventTypes.MESOS_STATE_CHANGE,
this.onMesosStoreChange
);

// We want to always request the summary endpoint. This will ensure that
// our charts always have data to render.
Expand Down Expand Up @@ -80,6 +85,10 @@ var Index = React.createClass({
EventTypes.CONFIG_ERROR,
this.onConfigError
);
MesosStateStore.removeChangeListener(
EventTypes.MESOS_STATE_CHANGE,
this.onMesosStoreChange
);
},

onSideBarChange() {
Expand Down Expand Up @@ -108,6 +117,8 @@ var Index = React.createClass({
});
},

onMesosStoreChange() {},

getErrorScreen(showErrorScreen) {
if (!showErrorScreen) {
return null;
Expand Down
28 changes: 18 additions & 10 deletions tests/smoke-cy.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
describe("DC/OS UI [00j]", function() {
beforeEach(function() {
cy
.configureCluster({
mesos: "1-task-healthy"
})
.visitUrl({ url: "/", identify: true, fakeAnalytics: true });
cy.configureCluster({
mesos: "1-task-healthy"
}).visitUrl({ url: "/", identify: true, fakeAnalytics: true });
});

context("Dashboard [00k]", function() {
beforeEach(function() {
cy.get(".sidebar-menu-item").contains("Dashboard").click();
cy.get(".sidebar-menu-item")
.contains("Dashboard")
.click();
});

it("can change hash to dashboard page [00l]", function() {
cy.hash().should("match", /dashboard/);
});

it("has eight panels [00m]", function() {
cy.get("#application").find(".panel").should("to.have.length", 8);
cy.get("#application")
.find(".panel")
.should("to.have.length", 8);
});
});

xcontext("Services [00n]", function() {
beforeEach(function() {
cy.get(".sidebar-menu-item").contains("Services").click();
cy.get(".sidebar-menu-item")
.contains("Services")
.click();
cy.get("table tbody tr").as("tableRows");
});

Expand All @@ -42,15 +46,19 @@ describe("DC/OS UI [00j]", function() {

context("Nodes [00r]", function() {
beforeEach(function() {
cy.get(".sidebar-menu-item").contains("Nodes").click();
cy.get(".sidebar-menu-item")
.contains("Nodes")
.click();
});

it("can change hash to nodes page [00s]", function() {
cy.hash().should("match", /nodes/);
});

it("displays one row on the table [00t]", function() {
cy.get("table tbody tr").should("to.have.length", 3).contains("dcos-01");
cy.get("table tbody tr")
.should("to.have.length", 6)
.contains("dcos-01");
});
});
});

0 comments on commit 3298195

Please sign in to comment.