From 16d4b49599ac680ae26b5cc5a8c2ea830056f966 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Apr 2024 16:50:33 +0000 Subject: [PATCH 1/2] Bump jest-webextension-mock from 3.8.9 to 3.8.16 Bumps [jest-webextension-mock](https://github.com/RickyMarou/jest-webextension-mock) from 3.8.9 to 3.8.16. - [Changelog](https://github.com/RickyMarou/jest-webextension-mock/blob/main/CHANGELOG.md) - [Commits](https://github.com/RickyMarou/jest-webextension-mock/compare/v3.8.9...3.8.16) --- updated-dependencies: - dependency-name: jest-webextension-mock dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 7 ++++--- package.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2490d1874f..6ce0bbe78a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -241,7 +241,7 @@ "jest-environment-jsdom": "^29.7.0", "jest-extended": "^4.0.2", "jest-location-mock": "^2.0.0", - "jest-webextension-mock": "^3.8.9", + "jest-webextension-mock": "^3.8.16", "jsdom": "^24.0.0", "jsdom-testing-mocks": "^1.13.0", "knip": "^5.11.0", @@ -20625,8 +20625,9 @@ } }, "node_modules/jest-webextension-mock": { - "version": "3.8.9", - "integrity": "sha512-PglflLBEhqAtfKOmwEcP2iV2YdQK3Xwa7e/SELIK/4+y1NiKSJnba7DdPe32HavHJCJwuL8bpVwFrxGZFD2m+A==", + "version": "3.8.16", + "resolved": "https://registry.npmjs.org/jest-webextension-mock/-/jest-webextension-mock-3.8.16.tgz", + "integrity": "sha512-bFEaRBuF+QZkPsprJfCXGuTTCvBm368y9ComlwIu30Z1ia2B+cHqHr45qABgRvTwb0eojbhsawJliqhiRypQwA==", "dev": true }, "node_modules/jest-worker": { diff --git a/package.json b/package.json index 3ca3f8933a..0da551a9d5 100644 --- a/package.json +++ b/package.json @@ -267,7 +267,7 @@ "jest-environment-jsdom": "^29.7.0", "jest-extended": "^4.0.2", "jest-location-mock": "^2.0.0", - "jest-webextension-mock": "^3.8.9", + "jest-webextension-mock": "^3.8.16", "jsdom": "^24.0.0", "jsdom-testing-mocks": "^1.13.0", "knip": "^5.11.0", From fadcf18bf6c0fc55328c5a39f13d9f6f15a5609c Mon Sep 17 00:00:00 2001 From: Graham Langford Date: Tue, 30 Apr 2024 11:55:15 -0500 Subject: [PATCH 2/2] fix assertions --- src/store/enterprise/managedStorage.test.ts | 9 +-------- src/store/enterprise/useManagedStorageState.test.ts | 3 --- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/store/enterprise/managedStorage.test.ts b/src/store/enterprise/managedStorage.test.ts index 5de2be25e3..a50649756e 100644 --- a/src/store/enterprise/managedStorage.test.ts +++ b/src/store/enterprise/managedStorage.test.ts @@ -32,11 +32,7 @@ beforeEach(async () => { describe("readManagedStorage", () => { it("reads immediately if managed storage is already initialized", async () => { await initializationTimestamp.set(new Date().toISOString() as Timestamp); - await expect(readManagedStorage()).resolves.toStrictEqual({ - // `jest-webextension-mock`'s storage is shared across sources, the call ends up with the managed storage - // and the local storage mixed together. See https://github.com/clarkbw/jest-webextension-mock/issues/183 - managedStorageInitTimestamp: expect.any(String), - }); + await expect(readManagedStorage()).resolves.toStrictEqual({}); // Should only be called once vs. polling expect(browser.storage.managed.get).toHaveBeenCalledOnce(); @@ -49,9 +45,6 @@ describe("readManagedStorage", () => { it("reads managed storage", async () => { await browser.storage.managed.set({ partnerId: "taco-bell" }); await expect(readManagedStorage()).resolves.toStrictEqual({ - // `jest-webextension-mock`'s storage is shared across sources, the call ends up with the managed storage - // and the local storage mixed together. See https://github.com/clarkbw/jest-webextension-mock/issues/183 - managedStorageInitTimestamp: expect.any(String), partnerId: "taco-bell", }); }); diff --git a/src/store/enterprise/useManagedStorageState.test.ts b/src/store/enterprise/useManagedStorageState.test.ts index aafa345a52..973e208944 100644 --- a/src/store/enterprise/useManagedStorageState.test.ts +++ b/src/store/enterprise/useManagedStorageState.test.ts @@ -66,9 +66,6 @@ describe("useManagedStorageState", () => { expect(result.current).toStrictEqual({ data: { - // `jest-webextension-mock`'s storage is shared across sources, the call ends up with the managed storage - // and the local storage mixed together. See https://github.com/clarkbw/jest-webextension-mock/issues/183 - managedStorageInitTimestamp: expect.any(String), partnerId: "taco-bell", }, isLoading: false,