Merge "Magic Search filter facet removal fix"
This commit is contained in:
commit
9ba9a54d0f
@ -334,6 +334,10 @@
|
||||
delete ctrl.textSearch;
|
||||
} else {
|
||||
$scope.$emit(magicSearchEvents.SEARCH_UPDATED, query);
|
||||
if (angular.isDefined(ctrl.textSearch)) {
|
||||
// emit text search if text facet remains
|
||||
emitTextSearch(ctrl.textSearch || '');
|
||||
}
|
||||
if (ctrl.currentSearch.length > 0) {
|
||||
// prune facets as needed from menus
|
||||
var newFacet = ctrl.currentSearch[ctrl.currentSearch.length - 1].name;
|
||||
|
@ -509,6 +509,14 @@
|
||||
expect(scope.strings.prompt).toEqual('');
|
||||
});
|
||||
|
||||
it("emits textSearch if text facet remains", function() {
|
||||
spyOn(scope, '$emit');
|
||||
ctrl.currentSearch = [{}];
|
||||
ctrl.textSearch = 'cat';
|
||||
ctrl.removeFacet(0);
|
||||
expect(scope.$emit).toHaveBeenCalledWith(magicSearchEvents.TEXT_SEARCH, 'cat', undefined);
|
||||
});
|
||||
|
||||
it("resets state if facet selected", function() {
|
||||
ctrl.currentSearch = [{}];
|
||||
ctrl.facetSelected = {};
|
||||
|
Loading…
Reference in New Issue
Block a user