Skip to content

Commit

Permalink
chore: add test coverage for URL normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
asthabh23 committed Dec 6, 2024
1 parent 776a2bd commit 1d7e6d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/facets.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1d7e6d3

Please sign in to comment.