discourse/test/javascripts/acceptance/header-test-staff.js.es6

34 lines
1,005 B
Text
Raw Normal View History

import { acceptance } from "helpers/qunit-helpers";
acceptance("Header (Staff)", {
2014-07-31 14:17:18 -04:00
user: { username: 'test',
staff: true,
site_flagged_posts_count: 1 }
});
test("header", () => {
2014-07-31 14:17:18 -04:00
visit("/");
// Notifications
click("#user-notifications");
andThen(() => {
2014-07-31 14:17:18 -04: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");
andThen(() => {
2014-07-31 14:17:18 -04: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");
andThen(() => {
2014-07-31 14:17:18 -04: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");
});
});