diff --git a/tests/lib/philomena/tag-utils.spec.ts b/tests/lib/philomena/tag-utils.spec.ts index c95d56e..6ae1198 100644 --- a/tests/lib/philomena/tag-utils.spec.ts +++ b/tests/lib/philomena/tag-utils.spec.ts @@ -11,7 +11,6 @@ describe('tag-utils', () => { } describe('Parsing from /search/?q=tag links', () => { - // Test cases for tags separated by commas it('should resolve a single tag from /search URLs', () => { expect(resolveFromSearchQuery('safe')).toBe('safe'); }); @@ -21,6 +20,11 @@ describe('tag-utils', () => { expect(resolveFromSearchQuery('safe, suggestive')).toBe(null); }); + it('should return null if query is empty or not a term', () => { + expect(resolveFromSearchQuery('')).toBe(null); + expect(resolveFromSearchQuery('!')).toBe(null); + }); + it('should properly treat parentheses in the query with single tag', () => { // Parentheses are operators in the query language, but when inside the tag name, they should still be properly // working.