mirror of
https://github.com/discourse/discourse.git
synced 2024-12-04 05:23:39 +08:00
32 lines
973 B
Plaintext
32 lines
973 B
Plaintext
|
integration("Header (Staff)", {
|
||
|
user: { username: 'test',
|
||
|
staff: true,
|
||
|
site_flagged_posts_count: 1 }
|
||
|
});
|
||
|
|
||
|
test("header", function() {
|
||
|
visit("/");
|
||
|
|
||
|
// Notifications
|
||
|
click("#user-notifications");
|
||
|
andThen(function() {
|
||
|
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(function() {
|
||
|
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(function() {
|
||
|
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");
|
||
|
});
|
||
|
});
|