mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-05 12:26:34 +02:00
fix wildcard error for class on select dropdown (#9909)
This commit is contained in:
parent
790715719b
commit
b2b7626956
@ -6,7 +6,11 @@ export function isWildcardString([string]) {
|
||||
}
|
||||
// string is actually an object which is what comes in in the searchSelect component
|
||||
if (typeof string === 'object') {
|
||||
string = Object.values(string)[0];
|
||||
// if the dropdown is used the object is a class which cannot be converted into a string
|
||||
if (Object.prototype.hasOwnProperty.call(string, 'store')) {
|
||||
return false;
|
||||
}
|
||||
string = Object.values(string).toString();
|
||||
}
|
||||
|
||||
return string.includes('*');
|
||||
|
||||
@ -26,9 +26,15 @@ module('Unit | Helpers | is-wildcard-string', function() {
|
||||
assert.equal(result, true);
|
||||
});
|
||||
|
||||
test('it returns true if string object has name and id with with at least one wildcard', function(assert) {
|
||||
test('it returns true if string object has name and id with at least one wildcard', function(assert) {
|
||||
let string = { id: '7*', name: 'seven' };
|
||||
let result = isWildcardString([string]);
|
||||
assert.equal(result, true);
|
||||
});
|
||||
|
||||
test('it returns true if string object has name and id with wildcard in name not id', function(assert) {
|
||||
let string = { id: '7', name: 'sev*n' };
|
||||
let result = isWildcardString([string]);
|
||||
assert.equal(result, true);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user