diff --git a/tests/scriptlets/href-sanitizer.test.js b/tests/scriptlets/href-sanitizer.test.js index a473c3b5..f933646c 100644 --- a/tests/scriptlets/href-sanitizer.test.js +++ b/tests/scriptlets/href-sanitizer.test.js @@ -64,7 +64,7 @@ test('Checking if alias name works', (assert) => { assert.strictEqual(codeByAdgParams, codeByUboParams, 'ubo name - ok'); }); -test('Santize href - base64 where link decoded as a string in data-href attribute', (assert) => { +test('Sanitize href - base64 where link decoded as a string in data-href attribute', (assert) => { const expectedHref = 'https://example.org/'; const elem = createElem('https://google.com/', expectedHref, 'data-href', 'aHR0cHM6Ly9leGFtcGxlLm9yZy8='); const selector = 'a[href^="https://google.com/'; @@ -76,7 +76,7 @@ test('Santize href - base64 where link decoded as a string in data-href attribut assert.strictEqual(window.hit, 'FIRED'); }); -test('Santize href - base64 where link decoded as a string in href attribute', (assert) => { +test('Sanitize href - base64 where link decoded as a string in href attribute', (assert) => { const expectedHref = 'http://example.com/?v=123'; const hrefWithBase64 = 'http://www.foo.com/out/?aHR0cDovL2V4YW1wbGUuY29tLz92PTEyMw=='; const elem = createElem(hrefWithBase64); @@ -88,7 +88,7 @@ test('Santize href - base64 where link decoded as a string in href attribute', ( assert.strictEqual(window.hit, 'FIRED'); }); -test('Santize href - base64 where link decoded in object in href attribute', (assert) => { +test('Sanitize href - base64 where link decoded in object in href attribute', (assert) => { const expectedHref = 'http://example.com/?v=3468'; const hrefWithBase64 = 'http://www.foo.com/out/?eyJsIjoiaHR0cDovL2V4YW1wbGUuY29tLz92PTM0NjgiLCJjIjoxfQ=='; const elem = createElem(hrefWithBase64); @@ -100,7 +100,7 @@ test('Santize href - base64 where link decoded in object in href attribute', (as assert.strictEqual(window.hit, 'FIRED'); }); -test('Santize href - text content', (assert) => { +test('Sanitize href - text content', (assert) => { const expectedHref = 'https://example.org/'; const elem = createElem('https://example.com/foo?redirect=https%3A%2F%2Fexample.org%2F', expectedHref); const selector = 'a[href*="?redirect="]'; @@ -112,7 +112,7 @@ test('Santize href - text content', (assert) => { assert.strictEqual(window.hit, 'FIRED'); }); -test('Santize href - text content, create element after running scriptlet', (assert) => { +test('Sanitize href - text content, create element after running scriptlet', (assert) => { const selector = 'a[href*="foo.com"]'; const scriptletArgs = [selector]; runScriptlet(name, scriptletArgs); @@ -128,7 +128,7 @@ test('Santize href - text content, create element after running scriptlet', (ass }, 10); }); -test('Santize href - text content special characters', (assert) => { +test('Sanitize href - text content special characters', (assert) => { const expectedHref = 'https://example.com/search?q=łódź'; const elem = createElem('https://example.org/foo', expectedHref); const selector = 'a[href*="//example.org"]'; @@ -140,7 +140,7 @@ test('Santize href - text content special characters', (assert) => { assert.strictEqual(window.hit, 'FIRED'); }); -test('Santize href - text content, Twitter like case', (assert) => { +test('Sanitize href - text content, Twitter like case', (assert) => { const elem = createElem('https://example.com/foo', 'https://agrd.io/promo_turk_83off…'); // Link from Twitter/X const expectedHref = 'https://agrd.io/promo_turk_83off'; const selector = 'a[href*="//example.com"]'; @@ -152,7 +152,7 @@ test('Santize href - text content, Twitter like case', (assert) => { assert.strictEqual(window.hit, 'FIRED'); }); -test('Santize href - query parameter 1', (assert) => { +test('Sanitize href - query parameter 1', (assert) => { const elem = createElem('https://example.com/foo?redirect=https://example.org/'); const expectedHref = 'https://example.org/'; const selector = 'a[href*="?redirect="]'; @@ -165,7 +165,7 @@ test('Santize href - query parameter 1', (assert) => { assert.strictEqual(window.hit, 'FIRED'); }); -test('Santize href - query parameter 2', (assert) => { +test('Sanitize href - query parameter 2', (assert) => { const elem = createElem('https://greenmangaming.sjv.io/c/3659980/1281797/15105?u=https://www.greenmangaming.com/games/grand-theft-auto-v-premium-edition-pc'); const expectedHref = 'https://www.greenmangaming.com/games/grand-theft-auto-v-premium-edition-pc'; const selector = 'a[href^="https://greenmangaming.sjv.io/c/"][href*="?u="]'; @@ -178,7 +178,7 @@ test('Santize href - query parameter 2', (assert) => { assert.strictEqual(window.hit, 'FIRED'); }); -test('Santize href - get href from attribute', (assert) => { +test('Sanitize href - get href from attribute', (assert) => { const expectedHref = 'https://example.org/'; const elem = createElem('https://foo.com/bar', '', 'data-href', expectedHref); const selector = 'a[href="https://foo.com/bar"]'; @@ -191,7 +191,7 @@ test('Santize href - get href from attribute', (assert) => { assert.strictEqual(window.hit, 'FIRED'); }); -test('Santize href - invalid URL', (assert) => { +test('Sanitize href - invalid URL', (assert) => { const expectedHref = 'https://foo.com/bar'; const elem = createElem(expectedHref, 'https://?'); const selector = 'a[href="https://foo.com/bar"]'; @@ -203,7 +203,7 @@ test('Santize href - invalid URL', (assert) => { assert.strictEqual(window.hit, 'FIRED'); }); -test('Santize href - parameter, invalid URL', (assert) => { +test('Sanitize href - parameter, invalid URL', (assert) => { const expectedHref = 'https://?example.com/foo?redirect=https://example.org/'; const elem = createElem(expectedHref); const selector = 'a[href*="?redirect="]'; @@ -216,7 +216,7 @@ test('Santize href - parameter, invalid URL', (assert) => { assert.strictEqual(window.hit, 'FIRED'); }); -test('Santize href - not allowed protocol', (assert) => { +test('Sanitize href - not allowed protocol', (assert) => { const expectedHref = 'https://example.com/foo?redirect=javascript:alert(1)'; const elem = createElem(expectedHref); const selector = 'a[href*="?redirect="]';