Commit 879a8fea authored by Kushal Pandya's avatar Kushal Pandya

Hide preloaded token values while searching

Hides preloaded token values within BaseToken while
search is active.
parent 449a63ad
......@@ -184,7 +184,7 @@ export default {
<gl-dropdown-divider />
</template>
<slot
v-if="preloadedTokenValues.length"
v-if="preloadedTokenValues.length && !searchKey"
name="token-values-list"
:token-values="preloadedTokenValues"
></slot>
......
......@@ -290,6 +290,14 @@ describe('AuthorToken', () => {
expect(firstSuggestion).toContain('Administrator');
expect(firstSuggestion).toContain('@root');
});
it('does not show current user while searching', async () => {
wrapper.findComponent(BaseToken).vm.handleInput({ data: 'foo' });
await wrapper.vm.$nextTick();
expect(wrapper.findComponent(GlFilteredSearchSuggestion).exists()).toBe(false);
});
});
});
});
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