From 12bfe0f9fdad5bfea680d897c81319684ee82180 Mon Sep 17 00:00:00 2001 From: hackademix Date: Tue, 2 Oct 2018 23:00:02 +0200 Subject: Adjusting for the fixes to the malformed license parsing. --- test/spec/LibreJSSpec.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'test/spec') diff --git a/test/spec/LibreJSSpec.js b/test/spec/LibreJSSpec.js index eba69b5..3d61973 100644 --- a/test/spec/LibreJSSpec.js +++ b/test/spec/LibreJSSpec.js @@ -21,10 +21,6 @@ "use strict"; describe("LibreJS' components", () => { - const LENIENT_TAG_MSG = - `actual requirement? at this moment (20181001) - formal validity only gets checked, therefore this test would fail.`; - let LibreJS = browser.extension.getBackgroundPage().LibreJS; let license = { id: 'GPL-3.0', @@ -39,8 +35,8 @@ describe("LibreJS' components", () => { let trivial = "1+1"; let nontrivial = `function nt() { document.documentElement.innerHTML=""; nt(); }`; - let licensed = `// @license ${license.id} ${license.magnet}\n${nontrivial}\n// @license-end`; - let unknownLicensed = `// @license ${unknownLicense.id} ${unknownLicense.magnet}\n${nontrivial}\n// @license-end`; + let licensed = `// @license ${license.magnet} ${license.id}\n${nontrivial}\n// @license-end`; + let unknownLicensed = `// @license ${unknownLicense.magnet} ${unknownLicense.id}\n${nontrivial}\n// @license-end`; let malformedLicensed = `// @license\n${nontrivial}`; let tab, documentUrl; @@ -79,10 +75,10 @@ describe("LibreJS' components", () => { expect(processed || licensed).toContain(nontrivial); }); - xit("should block scripts with unknown license tags", async () => { + it("should block scripts with unknown license tags", async () => { let processed = await processScript(unknownLicensed); expect(processed).not.toContain(nontrivial); - }).pend(LENIENT_TAG_MSG); + }); it("should block scripts with malformed license tags", async () => { let processed = await processScript(malformedLicensed); @@ -137,11 +133,11 @@ describe("LibreJS' components", () => { expect(extractScripts(processed, licensed)).toContain(nontrivial); }); - xit("should block scripts with unknown license tags", async () => { + it("should block scripts with unknown license tags", async () => { let unknownInHtml = addScript(html, unknownLicensed); let processed = await processHtml(unknownInHtml); expect(extractScripts(processed, nontrivial)).not.toContain(nontrivial); - }).pend(LENIENT_TAG_MSG); + }); it("should block scripts with malformed license tags", async () => { let malformedInHtml = addScript(html, malformedLicensed); -- cgit v1.2.3