Add Acceptance Tests (which found an error)

Tests for populating category and tags

Added acceptance tests for populating the Username and Category through the Advanced Search UI (will work on the other fields later)

Give the combo-box elements ids
Add acceptance tests for the rest of the advanced search UI (except for Tags, tags are evil)
This commit is contained in:
cpradio
2016-10-06 15:18:05 -04:00
parent 4b71fd253b
commit a7507dad63
4 changed files with 245 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
import { on, observes, default as computed } from 'ember-addons/ember-computed-decorators';
const REGEXP_FILTER_PREFIXES = /(user:|@|category:|#|group:|badge:|tags?:|in:|status:|posts_count:|(before|after):)/ig;
const REGEXP_FILTER_PREFIXES = /\s?(user:|@|category:|#|group:|badge:|tags?:|in:|status:|posts_count:|(before|after):)/ig;
const REGEXP_USERNAME_PREFIX = /\s?(user:|@)/ig;
const REGEXP_CATEGORY_PREFIX = /\s?(category:|#)/ig;
@@ -65,6 +65,9 @@ export default Em.Component.extend({
},
findSearchTerm(EXPRESSION, searchTerm) {
if (!searchTerm)
return "";
const expression_location = searchTerm.search(EXPRESSION);
if (expression_location === -1)
return "";

View File

@@ -48,13 +48,13 @@
<div class="control-group pull-left">
<label class="control-label" for="search-in-options">{{i18n "search.advanced.filters.label"}}</label>
<div class="controls">
{{combo-box valueAttribute="value" content=inOptions value=searchedTerms.in none="user.locale.any"}}
{{combo-box id="in" valueAttribute="value" content=inOptions value=searchedTerms.in none="user.locale.any"}}
</div>
</div>
<div class="control-group pull-left">
<label class="control-label" for="search-status-options">{{i18n "search.advanced.statuses.label"}}</label>
<div class="controls">
{{combo-box valueAttribute="value" content=statusOptions value=searchedTerms.status none="user.locale.any"}}
{{combo-box id="status" valueAttribute="value" content=statusOptions value=searchedTerms.status none="user.locale.any"}}
</div>
</div>
</div>
@@ -63,7 +63,7 @@
<div class="control-group pull-left">
<label class="control-label" for="search-post-date">{{i18n "search.advanced.post.time.label"}}</label>
<div class="controls">
{{combo-box valueAttribute="value" content=postTimeOptions value=searchedTerms.time.when}}
{{combo-box id="post-time" valueAttribute="value" content=postTimeOptions value=searchedTerms.time.when}}
{{input type="text" value=searchedTerms.time.days class="input-small" id='search-post-date'}}
</div>
</div>