mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 12:53:44 +08:00
921dd75dd9
FEATURE: display category in search results FEATURE: display topic state (locked/pinned/etc) in search results UI cleanup for search results, clearing floats and so on.
46 lines
1.7 KiB
JavaScript
46 lines
1.7 KiB
JavaScript
integration("Header (Anonymous)");
|
|
|
|
test("header", function() {
|
|
visit("/");
|
|
andThen(function() {
|
|
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");
|
|
});
|
|
|
|
// Logo changing
|
|
andThen(function() {
|
|
controllerFor('header').set("showExtraInfo", true);
|
|
});
|
|
|
|
andThen(function() {
|
|
ok(exists(".logo-small"), "it shows the small logo when `showExtraInfo` is enabled");
|
|
});
|
|
|
|
// Site Map
|
|
click("#site-map");
|
|
andThen(function() {
|
|
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(function() {
|
|
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
|
|
// TODO: @Robin how do I update this? can we have some sort of comment at the top?
|
|
// fillIn("#search-term", "hello");
|
|
// andThen(function() {
|
|
// ok(exists("#search-dropdown .heading"), "when user completes a search, search box shows search results");
|
|
// equal(find("#search-dropdown a:not(.filter):first").attr("href"), "some-url", "there is a search result");
|
|
// });
|
|
});
|