From 773b6f007093090ae32e572f1e3ce011725f4d0d Mon Sep 17 00:00:00 2001 From: Shakeel Mohamed Date: Sat, 20 Apr 2024 22:48:19 -0700 Subject: [PATCH] fix sourcery AI test problem --- test/javascript_components.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/javascript_components.js b/test/javascript_components.js index a917572..dd9146a 100644 --- a/test/javascript_components.js +++ b/test/javascript_components.js @@ -38,7 +38,7 @@ let _js = ""; assert.ok(j); }); - it("should load DOMPurify", async function() { + it("should load DOMPurify and sanitize", async function() { const page = await browser.newPage(); await page.goto(indexHTMLURL); @@ -48,10 +48,10 @@ let _js = ""; assert.ok(dp, "DOMPurify should be loaded on the page."); const sanitizedOutput = await page.evaluate(() => { - const dirty = ''; - return DOMPurify.sanitize(dirty); + const dirty = ""; + return window.DOMPurify.sanitize(dirty); }); - assert.strictEqual(sanitizedOutput, '', "DOMPurify should sanitize malicious scripts correctly."); + assert.strictEqual(sanitizedOutput, "", "DOMPurify should sanitize malicious scripts correctly."); }); // TODO: implement this test! _js is always empty