Add a test for empty behavior

This commit is contained in:
MareStare 2025-03-18 23:09:37 +00:00
parent 9bdb3a334f
commit 79c611a6f9

View file

@ -61,7 +61,16 @@ describe('Suggestions', () => {
[popup, input] = mockBaseSuggestionsPopup();
expect(document.querySelector('.autocomplete')).toBeInstanceOf(HTMLElement);
expect(popup.isHidden).toBe(false);
assert(popup.isHidden);
});
it('should hide the popup when there are no suggestions to show', () => {
[popup, input] = mockBaseSuggestionsPopup();
popup.setSuggestions({ history: [], tags: [] });
popup.showForElement(input);
assert(popup.isHidden);
});
it('should render suggestions', () => {