Skip to content
Snippets Groups Projects
Commit 65f534da authored by Heinrich Lee Yu's avatar Heinrich Lee Yu :basketball:
Browse files

Fix rendering of user token special values

Include capitalized `none` and `any` as special values
parent 1322146b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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;
}
 
Loading
Loading
Loading
Loading
@@ -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);
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment