FIX: Search menu results does not refresh when search context is changed.

This commit is contained in:
Guo Xiang Tan
2017-02-03 11:28:54 +08:00
parent 758e3e52f7
commit ac37bd3dbc
3 changed files with 34 additions and 1 deletions

View File

@@ -47,3 +47,29 @@ test("search scope checkbox", () => {
});
});
test("Search with context", assert => {
visit("/t/internationalization-localization/280/1");
click('#search-button');
fillIn('#search-term', 'dev');
click(".search-context input[type='checkbox']");
keyEvent('#search-term', 'keyup', 16);
andThen(() => {
assert.ok(exists('.search-menu .results ul li'), 'it shows results');
});
visit("/");
click('#search-button');
andThen(() => {
assert.ok(!exists(".search-context input[type='checkbox']"));
});
visit("/t/internationalization-localization/280/1");
click('#search-button');
andThen(() => {
assert.ok(!$('.search-context input[type=checkbox]').is(":checked"));
});
});