From 22ed63382571242831114d7d1b11e153486bd719 Mon Sep 17 00:00:00 2001 From: Jack Pearkes Date: Tue, 10 Jun 2014 11:02:21 -0400 Subject: [PATCH] ui: add nodeShow test --- ui/tests/tests.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/ui/tests/tests.js b/ui/tests/tests.js index 3349800ba3..8ee1ecfab2 100755 --- a/ui/tests/tests.js +++ b/ui/tests/tests.js @@ -68,8 +68,9 @@ test("servicesShow", function() { ok(find(".ember-list-item-view .list-group-item").hasClass('active'), "highlights active service"); ok(find(".ember-list-item-view .name:contains('"+ fixtures.service +"')"), "uses service name"); ok(find(".ember-list-item-view .name:contains('passing')"), "shows passing check num"); - equal(find("h5").text(), "Nodes", "Shows node list"); - ok(find("h3.panel-title:contains('"+ fixtures.node +"')"), "Shows node name"); + ok(find("h3:contains('"+ fixtures.service+"')"), "shows service name"); + equal(find("h5").text(), "Nodes", "shows node list"); + ok(find("h3.panel-title:contains('"+ fixtures.node +"')"), "shows node name"); }); }); @@ -85,6 +86,21 @@ test("nodes", function() { }); }); +test("nodesShow", function() { + visit("/"); + click("a:contains('Nodes')"); + // First item in list + click('.ember-list-item-view .list-group-item'); + + andThen(function() { + ok(find("a:contains('Nodes')").hasClass('active'), "highlights services in nav"); + equal(find(".ember-list-item-view").length, 1, "renders one service"); + ok(find(".ember-list-item-view .list-group-item").hasClass('active'), "highlights active node"); + ok(find(".ember-list-item-view .name:contains('"+ fixtures.node +"')"), "uses node name"); + ok(find(".ember-list-item-view .name:contains('passing')"), "shows passing check num"); + }); +}); + test("kv", function() { visit("/"); click("a:contains('Key/Value')");