mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-18 21:21:06 +02:00
* setup wild card helper and call the helper inside the search select component * change to wildcardLabel instead of wildCardLabel to keep consistent with usage * clean up errors * add wilcard functionality to roles * add tooltip delete functionality * move cli command to computed property too complicated for template and it didn't cover everything * edit modal on transformation when there's a role * make small adjustments based on logic confusion on my end * use brace expansion * fixes * filter-wildcard helper test * is-wildcard-string-test * search select test * check for empty array * nest conditional so wildcard helper doesn't get called uncessarily * remove wildcard from roles * refactor a little * clean up wildcard helper and test
35 lines
1.2 KiB
JavaScript
35 lines
1.2 KiB
JavaScript
import { isWildcardString } from 'vault/helpers/is-wildcard-string';
|
|
import { module, test } from 'qunit';
|
|
|
|
module('Unit | Helpers | is-wildcard-string', function() {
|
|
test('it returns true if regular string with wildcard', function(assert) {
|
|
let string = 'foom#*eep';
|
|
let result = isWildcardString([string]);
|
|
assert.equal(result, true);
|
|
});
|
|
|
|
test('it returns false if no wildcard', function(assert) {
|
|
let string = 'foo.bar';
|
|
let result = isWildcardString([string]);
|
|
assert.equal(result, false);
|
|
});
|
|
|
|
test('it returns true if string with id as in searchSelect selected has wildcard', function(assert) {
|
|
let string = { id: 'foo.bar*baz' };
|
|
let result = isWildcardString([string]);
|
|
assert.equal(result, true);
|
|
});
|
|
|
|
test('it returns true if string object has name and no id', function(assert) {
|
|
let string = { name: 'foo.bar*baz' };
|
|
let result = isWildcardString([string]);
|
|
assert.equal(result, true);
|
|
});
|
|
|
|
test('it returns true if string object has name and id with with at least one wildcard', function(assert) {
|
|
let string = { id: '7*', name: 'seven' };
|
|
let result = isWildcardString([string]);
|
|
assert.equal(result, true);
|
|
});
|
|
});
|