FEATURE: search should default scope to current category or user

This commit is contained in:
Neil Lalonde
2017-02-20 17:02:02 -05:00
parent 476ae57af3
commit 1dda998a4e
4 changed files with 48 additions and 2 deletions

View File

@ -24,3 +24,26 @@ test("search", (assert) => {
assert.ok(exists('.search-advanced-options'), 'advanced search is expanded');
});
});
test("search scope checkbox", () => {
visit("/c/bug");
click('#search-button');
andThen(() => {
ok(exists('.search-context input:checked'), 'scope to category checkbox is checked');
});
click('#search-button');
visit("/t/internationalization-localization/280");
click('#search-button');
andThen(() => {
not(exists('.search-context input:checked'), 'scope to topic checkbox is not checked');
});
click('#search-button');
visit("/users/eviltrout");
click('#search-button');
andThen(() => {
ok(exists('.search-context input:checked'), 'scope to user checkbox is checked');
});
});