2015-04-07 02:14:00 +08:00
|
|
|
import { acceptance } from "helpers/qunit-helpers";
|
|
|
|
acceptance("Header (Anonymous)");
|
2014-07-31 01:27:14 +08:00
|
|
|
|
2015-03-19 19:22:56 +08:00
|
|
|
test("header", () => {
|
2014-07-31 01:27:14 +08:00
|
|
|
visit("/");
|
2015-03-19 19:22:56 +08:00
|
|
|
andThen(() => {
|
2014-07-31 01:27:14 +08:00
|
|
|
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("#user-dropdown:visible"), "initially user dropdown is closed");
|
|
|
|
not(exists("#search-dropdown:visible"), "initially search box is closed");
|
|
|
|
});
|
|
|
|
|
|
|
|
// Logo changing
|
2015-03-19 19:22:56 +08:00
|
|
|
andThen(() => {
|
2014-07-31 06:56:01 +08:00
|
|
|
controllerFor('header').set("showExtraInfo", true);
|
2014-07-31 01:27:14 +08:00
|
|
|
});
|
|
|
|
|
2015-03-19 19:22:56 +08:00
|
|
|
andThen(() => {
|
2014-07-31 01:27:14 +08:00
|
|
|
ok(exists(".logo-small"), "it shows the small logo when `showExtraInfo` is enabled");
|
|
|
|
});
|
|
|
|
|
|
|
|
// Search
|
|
|
|
click("#search-button");
|
2015-03-19 19:22:56 +08:00
|
|
|
andThen(() => {
|
2015-08-27 04:55:01 +08:00
|
|
|
ok(exists(".search-menu:visible"), "after clicking a button search box opens");
|
|
|
|
not(exists(".search-menu .heading"), "initially, immediately after opening, search box is empty");
|
2014-07-31 01:27:14 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|