Commit e8981b9d authored by Eulyeon Ko's avatar Eulyeon Ko

Fix missing operator token for support bot

parent 0757395c
......@@ -649,7 +649,10 @@ export default class FilteredSearchManager {
hasFilteredSearch = true;
const canEdit = this.canEdit && this.canEdit(key, sanitizedValue);
const { uppercaseTokenName, capitalizeTokenValue } = match;
const operator = FilteredSearchVisualTokens.getOperatorToken(sanitizedValue);
const isSupportBot = keyParam === 'author_username' && value === 'support-bot';
const operator = isSupportBot
? '='
: FilteredSearchVisualTokens.getOperatorToken(sanitizedValue);
const sanitizedToken = FilteredSearchVisualTokens.getValueToken(sanitizedValue);
FilteredSearchVisualTokens.addFilterVisualToken(
key,
......
......@@ -152,6 +152,14 @@ RSpec.describe 'Service Desk Issue Tracker', :js do
find('.input-token .filtered-search').native.send_key(:backspace)
expect(page).to have_selector('.js-visual-token', count: 1)
end
it 'support bot author token has been properly added' do
within('.filtered-search-token') do
expect(page).to have_selector('.name', count: 1, visible: false)
expect(page).to have_selector('.operator', count: 1, visible: false)
expect(page).to have_selector('.value-container', count: 1, visible: false)
end
end
end
end
end
......
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