Ronald 9d21736e9f
Add UI copyright headers files (#16614)
* Add copyright headers to UI files

* Ensure copywrite file ignores external libs
2023-03-14 09:18:55 -04:00

45 lines
988 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import { module, test } from 'qunit';
import ExactSearch from 'consul-ui/utils/search/exact';
import predicates from 'consul-ui/search/predicates/policy';
module('Unit | Search | Predicate | policy', function () {
test('items are found by properties', function (assert) {
const actual = new ExactSearch(
[
{
Name: 'name-HIT',
Description: 'description',
},
{
Name: 'name',
Description: 'desc-HIT-ription',
},
],
{
finders: predicates,
}
).search('hit');
assert.equal(actual.length, 2);
});
test('items are not found', function (assert) {
const actual = new ExactSearch(
[
{
Name: 'name',
Description: 'description',
},
],
{
finders: predicates,
}
).search('hit');
assert.equal(actual.length, 0);
});
});