correct failing test

This commit is contained in:
Sam 2018-05-24 13:02:20 +10:00
parent 6a01a371ee
commit 4194886b62
3 changed files with 17 additions and 10 deletions

View File

@ -60,7 +60,7 @@
<div class="controls">
{{#if currentUser}}
<section class='field'>
<label>{{input type="checkbox" class="in-likes" checked=searchedTerms.special.in.title}} {{i18n "search.advanced.filters.title"}}</label>
<label>{{input type="checkbox" class="in-title" checked=searchedTerms.special.in.title}} {{i18n "search.advanced.filters.title"}}</label>
<label>{{input type="checkbox" class="in-likes" checked=searchedTerms.special.in.likes}} {{i18n "search.advanced.filters.likes"}}</label>
<label>{{input type="checkbox" class="in-private" checked=searchedTerms.special.in.private}} {{i18n "search.advanced.filters.private"}}</label>
<label>{{input type="checkbox" class="in-seen" checked=searchedTerms.special.in.seen}} {{i18n "search.advanced.filters.seen"}}</label>

View File

@ -175,16 +175,23 @@ QUnit.test("update category through advanced search ui", assert => {
// });
// });
// });
//
QUnit.test("update in:title filter through advanced search ui", async assert => {
await visit("/search");
await fillIn('.search-query', 'none');
await click('.search-advanced-options .in-title');
QUnit.test("update in:likes filter through advanced search ui", assert => {
visit("/search");
fillIn('.search-query', 'none');
click('.search-advanced-options .in-likes');
assert.ok(exists('.search-advanced-options .in-title:checked'), 'has "in title" populated');
assert.equal(find('.search-query').val(), "none in:title", 'has updated search term to "none in:title"');
});
andThen(() => {
assert.ok(exists('.search-advanced-options .in-likes:checked'), 'has "I liked" populated');
assert.equal(find('.search-query').val(), "none in:likes", 'has updated search term to "none in:likes"');
});
QUnit.test("update in:likes filter through advanced search ui", async assert => {
await visit("/search");
await fillIn('.search-query', 'none');
await click('.search-advanced-options .in-likes');
assert.ok(exists('.search-advanced-options .in-likes:checked'), 'has "I liked" populated');
assert.equal(find('.search-query').val(), "none in:likes", 'has updated search term to "none in:likes"');
});
QUnit.test("update in:private filter through advanced search ui", assert => {

View File

@ -57,7 +57,7 @@ async function runAllTests() {
// If it's a simple test result, write without newline
if(message === "." || message === "F"){
process.stdout.write(message);
} else if (message.startsWith("AUTOSPEC:")) {
} else if (message && message.startsWith("AUTOSPEC:")) {
fs.appendFileSync(QUNIT_RESULT, `${message.slice(10)}\n`);
} else {
console.log(message);