2015-04-06 14:14:00 -04:00
|
|
|
import { acceptance } from "helpers/qunit-helpers";
|
|
|
|
acceptance("Header (Anonymous)");
|
2014-07-30 13:27:14 -04:00
|
|
|
|
2015-03-19 07:22:56 -04:00
|
|
|
test("header", () => {
|
2014-07-30 13:27:14 -04:00
|
|
|
visit("/");
|
2015-03-19 07:22:56 -04:00
|
|
|
andThen(() => {
|
2014-07-30 13:27:14 -04: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 07:22:56 -04:00
|
|
|
andThen(() => {
|
2014-07-30 18:56:01 -04:00
|
|
|
controllerFor('header').set("showExtraInfo", true);
|
2014-07-30 13:27:14 -04:00
|
|
|
});
|
|
|
|
|
2015-03-19 07:22:56 -04:00
|
|
|
andThen(() => {
|
2014-07-30 13:27:14 -04:00
|
|
|
ok(exists(".logo-small"), "it shows the small logo when `showExtraInfo` is enabled");
|
|
|
|
});
|
|
|
|
|
|
|
|
// Search
|
|
|
|
click("#search-button");
|
2015-03-19 07:22:56 -04:00
|
|
|
andThen(() => {
|
2014-07-30 13:27:14 -04:00
|
|
|
ok(exists("#search-dropdown:visible"), "after clicking a button search box opens");
|
|
|
|
not(exists("#search-dropdown .heading"), "initially, immediately after opening, search box is empty");
|
|
|
|
});
|
|
|
|
|
|
|
|
// Perform Search
|
2015-04-02 02:39:41 -04:00
|
|
|
// TODO how do I fix the fixture to be a POST instead of a GET @eviltrout
|
|
|
|
// fillIn("#search-term", "hello");
|
|
|
|
// andThen(() => {
|
|
|
|
// ok(exists("#search-dropdown .heading"), "when user completes a search, search box shows search results");
|
|
|
|
// equal(find("#search-dropdown .results a:first").attr("href"), "/t/hello-bar-integration-issues/17638", "there is a search result");
|
|
|
|
// });
|
2014-07-30 13:27:14 -04:00
|
|
|
});
|