Remove identityState when deleting containers

Fixes #1140
This commit is contained in:
stoically
2022-06-23 01:45:06 +02:00
parent 66b90006bd
commit 76d5b36563
2 changed files with 28 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
const { sinon, nextTick, buildBackgroundDom } = require("../common");
describe("#1140", () => {
beforeEach(async () => {
this.background = await buildBackgroundDom();
});
describe("removing containers", () => {
beforeEach(async () => {
this.background.browser.contextualIdentities.onRemoved.addListener = sinon.stub();
const [promise] = this.background.browser.runtime.onMessage.addListener.yield({
method: "deleteContainer",
message: {
userContextId: "1"
}
});
await promise;
await nextTick();
});
it("should remove the identitystate from storage as well", async () => {
this.background.browser.storage.local.remove.should.have.been.calledWith([
"identitiesState@@_firefox-container-1"
]);
});
});
});