mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -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 "";
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user