import { describe, it, expect } from 'vitest'; import { classifyChannel, extractReferrerHost, normalizeHost, sanitizeLandingPath, sanitizeTag, } from '@/lib/analytics/channel'; // Every expected value below is written by hand. Deriving them from the lookup // tables in the module would mean deleting an entry from a table also deletes // its own test case. describe('sanitizeTag', () => { it('lowercases and trims', () => { expect(sanitizeTag(' GitHub ')).toBe('github'); }); it('rejects a tag carrying markup or control characters', () => { expect(sanitizeTag('