2015-04-07 02:14:00 +08:00
|
|
|
import { acceptance } from "helpers/qunit-helpers";
|
|
|
|
|
2015-04-02 02:18:46 +08:00
|
|
|
acceptance("Header (Staff)", { loggedIn: true });
|
2014-08-01 02:17:18 +08:00
|
|
|
|
2015-03-19 19:22:56 +08:00
|
|
|
test("header", () => {
|
2014-08-01 02:17:18 +08:00
|
|
|
visit("/");
|
|
|
|
|
|
|
|
// Notifications
|
|
|
|
click("#user-notifications");
|
2015-03-19 19:22:56 +08:00
|
|
|
andThen(() => {
|
2014-08-01 02:17:18 +08:00
|
|
|
var $items = $("#notifications-dropdown li");
|
|
|
|
ok(exists($items), "is lazily populated after user opens it");
|
|
|
|
ok($items.first().hasClass("read"), "correctly binds items' 'read' class");
|
|
|
|
});
|
|
|
|
|
|
|
|
// Site Map
|
|
|
|
click("#site-map");
|
2015-03-19 19:22:56 +08:00
|
|
|
andThen(() => {
|
2014-08-01 02:17:18 +08:00
|
|
|
ok(exists("#site-map-dropdown .admin-link"), "it has the admin link");
|
|
|
|
ok(exists("#site-map-dropdown .flagged-posts.badge-notification"), "it displays flag notifications");
|
|
|
|
});
|
|
|
|
|
|
|
|
// User dropdown
|
|
|
|
click("#current-user");
|
2015-03-19 19:22:56 +08:00
|
|
|
andThen(() => {
|
2014-08-01 02:17:18 +08:00
|
|
|
ok(exists("#user-dropdown:visible"), "is lazily rendered after user opens it");
|
|
|
|
ok(exists("#user-dropdown .user-dropdown-links"), "has showing / hiding user-dropdown links correctly bound");
|
|
|
|
});
|
|
|
|
});
|