Skip to content

Commit

Permalink
#83 - Ensure that non expanded domain item is removed on delete
Browse files Browse the repository at this point in the history
  • Loading branch information
Manvel committed Jan 11, 2020
1 parent f5c9bef commit 612488e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/ui/tabs/cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ browser.cookies.onChanged.addListener(async({cookie, removed}) =>

if (removed)
{
if (!pmTable.getItem(domain) || !pmTable.getItem(cookie.name, domain))
if (!pmTable.getItem(domain))
return;

if (!domainCounts[domain])
Expand Down
8 changes: 8 additions & 0 deletions test/puppeteer/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ describe("Testing Cookies tab", () =>
await page.waitFor(30);
equal(await ensureItem("name3", "domain4.com"), false);
equal(await ensureItem("domain4.com"), false);

// Ensure that non expanded domain item is removed on delete
// https://github.com/Privacy-Managers/Privacy-Manager/issues/83
await addCookie("https://domain4.com", "name1", "value1");
await page.waitFor(30);
await (await deleteButtonHandle("domain4.com")).click();
await page.waitFor(30);
equal(await ensureItem("domain4.com"), false);
});

it("Deleting cookies should also unset whitelisting", async() =>
Expand Down

0 comments on commit 612488e

Please sign in to comment.