restructure search-test to test all filters w/ variable visibiltiy
This commit is contained in:
parent
cea2a9fe53
commit
9c6c4a7705
|
@ -74,52 +74,48 @@ QUnit.test("Search with context", assert => {
|
|||
});
|
||||
});
|
||||
|
||||
QUnit.test("in:likes, in:private, and in:seen filters are hidden to anonymous users", assert => {
|
||||
QUnit.test("Right filters are shown to anonymous users", assert => {
|
||||
visit("/search?expanded=true");
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(exists('select#in option[value=first]'));
|
||||
assert.ok(exists('select#in option[value=pinned]'));
|
||||
assert.ok(exists('select#in option[value=unpinned]'));
|
||||
assert.ok(exists('select#in option[value=wiki]'));
|
||||
assert.ok(exists('select#in option[value=images]'));
|
||||
|
||||
assert.notOk(exists('select#in option[value=unseen]'));
|
||||
assert.notOk(exists('select#in option[value=posted]'));
|
||||
assert.notOk(exists('select#in option[value=watching]'));
|
||||
assert.notOk(exists('select#in option[value=tracking]'));
|
||||
assert.notOk(exists('select#in option[value=bookmarks]'));
|
||||
|
||||
assert.notOk(exists('.search-advanced-options .in-likes'));
|
||||
assert.notOk(exists('.search-advanced-options .in-private'));
|
||||
assert.notOk(exists('.search-advanced-options .in-seen'));
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.test("in:likes, in:private, and in:seen filters are available to logged in users", assert => {
|
||||
QUnit.test("Right filters are shown to logged-in users", assert => {
|
||||
logIn();
|
||||
Discourse.reset();
|
||||
visit("/search?expanded=true");
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(exists('.search-advanced-options .in-likes'));
|
||||
assert.ok(exists('.search-advanced-options .in-private'));
|
||||
assert.ok(exists('.search-advanced-options .in-seen'));
|
||||
});
|
||||
});
|
||||
assert.ok(exists('select#in option[value=first]'));
|
||||
assert.ok(exists('select#in option[value=pinned]'));
|
||||
assert.ok(exists('select#in option[value=unpinned]'));
|
||||
assert.ok(exists('select#in option[value=wiki]'));
|
||||
assert.ok(exists('select#in option[value=images]'));
|
||||
|
||||
QUnit.test(`"I've not read", "I posted in", "I'm watching", "I'm tracking",
|
||||
"I've bookmarked" filters are hidden to anonymous users from the dropdown`, assert => {
|
||||
visit("/search?expanded=true");
|
||||
|
||||
andThen(() => {
|
||||
assert.notOk(exists('select#in option[value=unseen]'));
|
||||
assert.notOk(exists('select#in option[value=posted]'));
|
||||
assert.notOk(exists('select#in option[value=watching]'));
|
||||
assert.notOk(exists('select#in option[value=tracking]'));
|
||||
assert.notOk(exists('select#in option[value=bookmarks]'));
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.test(`"I've not read", "I posted in", "I'm watching", "I'm tracking",
|
||||
"I've bookmarked" filters are available to logged in users in the dropdown`, assert => {
|
||||
logIn();
|
||||
Discourse.reset();
|
||||
visit("/search?expanded=true");
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(exists('select#in option[value=unseen]'));
|
||||
assert.ok(exists('select#in option[value=posted]'));
|
||||
assert.ok(exists('select#in option[value=watching]'));
|
||||
assert.ok(exists('select#in option[value=tracking]'));
|
||||
assert.ok(exists('select#in option[value=bookmarks]'));
|
||||
|
||||
assert.ok(exists('.search-advanced-options .in-likes'));
|
||||
assert.ok(exists('.search-advanced-options .in-private'));
|
||||
assert.ok(exists('.search-advanced-options .in-seen'));
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue