From 1d7e6d3193796a6827326b100e7ec7be6a753d77 Mon Sep 17 00:00:00 2001 From: asthabh23 Date: Fri, 6 Dec 2024 17:41:14 +0530 Subject: [PATCH] chore: add test coverage for URL normalization --- test/facets.test.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/facets.test.js b/test/facets.test.js index 9015d9f..92c92eb 100644 --- a/test/facets.test.js +++ b/test/facets.test.js @@ -216,6 +216,11 @@ describe('facets:enterSource', () => { assert.deepEqual(facets.enterSource({ events: [{ checkpoint: 'enter', source: 'https://www.google.com' }] }), ['https://www.google.com', 'search:google', 'search', '*:google']); }); + it('enterSource:normalizeUrl', () => { + assert.deepEqual(facets.enterSource({ events: [{ checkpoint: 'enter', source: 'https://www.example.com/#' }] }), ['https://www.example.com']); + assert.deepEqual(facets.enterSource({ events: [{ checkpoint: 'enter', source: 'https://www.google.com/#' }] }), ['https://www.google.com', 'search:google', 'search', '*:google']); + }); + it('enterSource:DataChunks', () => { const d = new DataChunks(); d.load(testChunks);