1
0
mirror of https://github.com/koloml/philomena-tagging-assistant.git synced 2026-06-23 18:22:20 +00:00

Cover the case when first term is not a term or when nothing is there

This commit is contained in:
2026-06-13 22:07:11 +04:00
parent 736c0917c0
commit 24d17416b5

View File

@@ -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.