2015-07-15 23:16:49 +08:00
|
|
|
import { acceptance } from "helpers/qunit-helpers";
|
|
|
|
acceptance("Search - Full Page");
|
|
|
|
|
2016-08-10 00:16:29 +08:00
|
|
|
test("perform various searches", assert => {
|
|
|
|
visit("/search");
|
|
|
|
|
|
|
|
andThen(() => {
|
|
|
|
assert.ok(find('input.search').length > 0);
|
2016-08-10 01:22:14 +08:00
|
|
|
assert.ok(find('.fps-topic').length === 0);
|
2016-08-10 00:16:29 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
fillIn('.search input', 'none');
|
|
|
|
click('.search .btn-primary');
|
|
|
|
|
2016-08-10 01:22:14 +08:00
|
|
|
andThen(() => assert.ok(find('.fps-topic').length === 0), 'has no results');
|
2016-08-10 00:16:29 +08:00
|
|
|
|
|
|
|
fillIn('.search input', 'posts');
|
|
|
|
click('.search .btn-primary');
|
|
|
|
|
2016-08-10 01:22:14 +08:00
|
|
|
andThen(() => assert.ok(find('.fps-topic').length === 1, 'has one post'));
|
2016-08-10 00:16:29 +08:00
|
|
|
});
|