Finds names by RegExp with i param for case insensitive

This commit is contained in:
Ariel Fuggini 2020-06-08 16:13:29 -05:00 committed by JC Brand
parent 22bcbfbbc8
commit 48fcbfa5ea
2 changed files with 6 additions and 1 deletions

View File

@ -192,6 +192,11 @@ describe("The groupchat moderator tool", function () {
filter.value = 'gower';
u.triggerEvent(filter, "keyup", "KeyboardEvent");
await u.waitUntil(() => ( modal.el.querySelectorAll('.list-group--users > li').length === 1));
filter.value = 'RoMeO';
u.triggerEvent(filter, "keyup", "KeyboardEvent");
await u.waitUntil(() => ( modal.el.querySelectorAll('.list-group--users > li').length === 1));
done();
}));

View File

@ -214,7 +214,7 @@ export default (o) => {
${ (o.users_with_affiliation instanceof Error) ?
html`<li class="list-group-item">${o.users_with_affiliation.message}</li>` :
(o.users_with_affiliation || []).map(item => ((item.nick || item.jid).match(o.affiliations_filter) ? affiliation_list_item(Object.assign({item}, o)) : '')) }
(o.users_with_affiliation || []).map(item => ((item.nick || item.jid).match(new RegExp(o.affiliations_filter, 'i')) ? affiliation_list_item(Object.assign({item}, o)) : '')) }
</ul>
</div>
</div>