Skip to content

Commit

Permalink
#99 - fixed failing dataDeletion tests and exit puppeteer
Browse files Browse the repository at this point in the history
  • Loading branch information
Manvel committed Dec 27, 2022
1 parent b270e45 commit ed41648
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Privacy Manager is a chrome extension for data transparency and control",
"scripts": {
"test": "npm run test:eslint && npm run test:stylelint && npm run test:puppeteer",
"test:puppeteer": "npm run build:webpack && mocha test/puppeteer/*.js --timeout 20000",
"test:puppeteer": "npm run build:webpack && mocha test/puppeteer/*.js --timeout 20000 --exit",
"test:eslint": "eslint src",
"test:stylelint": "stylelint src/**/*.css",
"build": "npm run build:webpack:prod && cd dist/;zip -r ../privacy-manager.zip .;cd ..",
Expand Down
16 changes: 8 additions & 8 deletions test/puppeteer/dataDeletion.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ describe("Testing Data deletion", () =>
it("Data deletion should clear data for the toggles that are enabled in the 'Clear on startup' section", async() =>
{
await page2.goto("http://127.0.0.1:4000/");
await page2.waitFor(50);
await page2.waitForTimeout(50);
ok(!await isLocalStorageSet());
ok(!await isCookieSet());
await setCookie();
await setStorage();
await page2.waitFor(50);
await page2.waitForTimeout(50);
ok(await isLocalStorageSet());
ok(await isCookieSet());

Expand All @@ -153,12 +153,12 @@ describe("Testing Data deletion", () =>
equal(await isEnabled(cookieHandle), true);
equal(await isEnabled(localStorage), true);
await triggerDataDeletion();
await page2.waitFor(50);
await page2.waitForTimeout(50);
ok(!await isLocalStorageSet());
ok(!await isCookieSet());
await clickToggle(await getHandle("cookies"));
await clickToggle(await getHandle("localStorage"));
await page2.waitFor(200);
await page2.waitForTimeout(200);
equal(await isEnabled(cookieHandle), false);
equal(await isEnabled(localStorage), false);
});
Expand All @@ -167,22 +167,22 @@ describe("Testing Data deletion", () =>
{
await setCookie();
await setStorage();
await page2.waitFor(50);
await page2.waitForTimeout(50);
ok(await isLocalStorageSet());
ok(await isCookieSet());

await clickToggle(await getHandle("removeAll"));
await page2.waitFor(50);
await page2.waitForTimeout(50);
await triggerDataDeletion();
await page2.waitFor(50);
await page2.waitForTimeout(50);
ok(!await isLocalStorageSet());
ok(!await isCookieSet());
});

after(async() =>
{
await restorePermissions();
await closeBrowser();
// await closeBrowser();
server.close();
});
});

0 comments on commit ed41648

Please sign in to comment.