FEATURE: Full height hamburger menu
- Rename `site-map` to `hamburger-menu` - Includes acceptance tests
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
|
||||
acceptance("Hamburger Menu - Staff", { loggedIn: true });
|
||||
|
||||
test("Menu Items", (assert) => {
|
||||
visit("/");
|
||||
click("#toggle-hamburger-menu");
|
||||
andThen(() => {
|
||||
assert.ok(exists("#hamburger-menu .admin-link"));
|
||||
assert.ok(exists("#hamburger-menu .flagged-posts-link"));
|
||||
assert.ok(exists("#hamburger-menu .flagged-posts.badge-notification"), "it displays flag notifications");
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,39 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
|
||||
acceptance("Hamburger Menu");
|
||||
|
||||
test("Toggle Menu", (assert) => {
|
||||
visit("/");
|
||||
andThen(() => {
|
||||
assert.ok(exists("#hamburger-menu.slideright"), "hidden by default");
|
||||
});
|
||||
|
||||
click("#toggle-hamburger-menu");
|
||||
andThen(() => {
|
||||
assert.ok(!exists("#hamburger-menu.slideright"), "a click makes it appear");
|
||||
});
|
||||
|
||||
click(".close-hamburger");
|
||||
andThen(() => {
|
||||
assert.ok(exists("#hamburger-menu.slideright"), "clicking the X hides it");
|
||||
});
|
||||
});
|
||||
|
||||
test("Menu Items", (assert) => {
|
||||
visit("/");
|
||||
click("#toggle-hamburger-menu");
|
||||
andThen(() => {
|
||||
assert.ok(!exists("#hamburger-menu .admin-link"));
|
||||
assert.ok(!exists("#hamburger-menu .flagged-posts-link"));
|
||||
|
||||
assert.ok(exists("#hamburger-menu .latest-topics-link"));
|
||||
assert.ok(exists("#hamburger-menu .badge-link"));
|
||||
assert.ok(exists("#hamburger-menu .user-directory-link"));
|
||||
assert.ok(exists("#hamburger-menu .keyboard-shortcuts-link"));
|
||||
assert.ok(exists("#hamburger-menu .faq-link"));
|
||||
assert.ok(exists("#hamburger-menu .about-link"));
|
||||
assert.ok(exists("#hamburger-menu .categories-link"));
|
||||
|
||||
assert.ok(exists('#hamburger-menu .category-link'));
|
||||
});
|
||||
});
|
||||
@@ -7,7 +7,6 @@ test("header", () => {
|
||||
ok(exists("header"), "is rendered");
|
||||
ok(exists(".logo-big"), "it renders the large logo by default");
|
||||
not(exists("#notifications-dropdown li"), "no notifications at first");
|
||||
not(exists('#site-map-dropdown'), "no site map by default");
|
||||
not(exists("#user-dropdown:visible"), "initially user dropdown is closed");
|
||||
not(exists("#search-dropdown:visible"), "initially search box is closed");
|
||||
});
|
||||
@@ -21,14 +20,6 @@ test("header", () => {
|
||||
ok(exists(".logo-small"), "it shows the small logo when `showExtraInfo` is enabled");
|
||||
});
|
||||
|
||||
// Site Map
|
||||
click("#site-map");
|
||||
andThen(() => {
|
||||
ok(exists('#site-map-dropdown'), "is rendered after user opens it");
|
||||
ok(exists("#site-map-dropdown .faq-link"), "it shows the faq link");
|
||||
ok(exists("#site-map-dropdown .category-links"), "has categories correctly bound");
|
||||
});
|
||||
|
||||
// Search
|
||||
click("#search-button");
|
||||
andThen(() => {
|
||||
|
||||
@@ -13,13 +13,6 @@ test("header", () => {
|
||||
ok($items.first().hasClass("read"), "correctly binds items' 'read' class");
|
||||
});
|
||||
|
||||
// Site Map
|
||||
click("#site-map");
|
||||
andThen(() => {
|
||||
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(() => {
|
||||
|
||||
@@ -37,7 +37,7 @@ test("redirect", () => {
|
||||
ok(invisible('.login-modal'), "it closes the login modal");
|
||||
});
|
||||
|
||||
click('#site-map');
|
||||
click('#toggle-hamburger-menu');
|
||||
andThen(() => {
|
||||
ok(exists('.login-modal'), "site map opens the login modal");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user