Commit 4b50e4d5 authored by Phil Hughes's avatar Phil Hughes

Merge branch '57692-fix-rendering-of-none-any' into 'master'

Resolve "Search bar rendering `none` and `any` as users"

Closes #57692

See merge request gitlab-org/gitlab-ce!25235
parents d9328cb3 65f534da
......@@ -163,7 +163,7 @@ export default class FilteredSearchVisualTokens {
const tokenValueElement = tokenValueContainer.querySelector('.value');
tokenValueElement.innerText = tokenValue;
if (tokenValue === 'none' || tokenValue === 'any') {
if (['none', 'any'].includes(tokenValue.toLowerCase())) {
return;
}
......
......@@ -755,6 +755,17 @@ describe('Filtered Search Visual Tokens', () => {
expect(updateUserTokenAppearanceSpy.calls.count()).toBe(0);
});
it('does not update user token appearance for `None` filter', () => {
const { tokenNameElement } = findElements(authorToken);
const tokenName = tokenNameElement.innerText;
const tokenValue = 'None';
subject.renderVisualTokenValue(authorToken, tokenName, tokenValue);
expect(updateUserTokenAppearanceSpy.calls.count()).toBe(0);
});
it('does not update user token appearance for `none` filter', () => {
const { tokenNameElement } = findElements(authorToken);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment