John Cowen 2c3b6aec05
ui: Remove old style 'filterable' searching (#9356)
* Switch upstream-instances to use new style of searchable

* Add search action to DataCollection plus basic README

* Use DataCollection for PowerSelect searching in child-selectors

* Remove old style filterable search for role/policies and instances

* Remove old helpers/components related to search/sort/filter
2020-12-09 19:12:17 +00:00

30 lines
787 B
JavaScript

import predicates from 'consul-ui/search/predicates/policy';
import { search as create } from 'consul-ui/services/search';
import { module, test } from 'qunit';
module('Unit | Search | Predicate | policy', function() {
const search = create(predicates);
test('items are found by properties', function(assert) {
const actual = [
{
Name: 'name-HIT',
Description: 'description',
},
{
Name: 'name',
Description: 'desc-HIT-ription',
},
].filter(search('hit'));
assert.equal(actual.length, 2);
});
test('items are not found', function(assert) {
const actual = [
{
Name: 'name',
Description: 'description',
},
].filter(search('hit'));
assert.equal(actual.length, 0);
});
});