Skip to content

Commit 19c04dd

Browse files
chore(deps): bump ws from 8.18.3 to 8.21.1 (#10)
* chore(deps): bump ws from 8.18.3 to 8.21.1 Bumps [ws](https://github.com/websockets/ws) from 8.18.3 to 8.21.1. - [Release notes](https://github.com/websockets/ws/releases) - [Commits](websockets/ws@8.18.3...8.21.1) --- updated-dependencies: - dependency-name: ws dependency-version: 8.21.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Fix Gemini summary expiry boundary test --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Michael Wu <michaelmwu@gmail.com>
1 parent b57cbd5 commit 19c04dd

2 files changed

Lines changed: 21 additions & 14 deletions

File tree

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/gemini.test.js

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,21 +1500,28 @@ describe("Gemini Component", () => {
15001500
});
15011501

15021502
test("should handle clearExpiredSummary with exactly 24 hours", async () => {
1503-
const exactTimestamp = Date.now() - 86400 * 1000;
1503+
const now = Date.now();
1504+
const dateNowSpy = jest.spyOn(Date, "now").mockReturnValue(now);
15041505

1505-
mockChromeStorage({
1506-
summaryList: [{ name: "Place", clue: "" }],
1507-
timestamp: exactTimestamp,
1508-
favoriteList: [],
1509-
});
1506+
try {
1507+
const exactTimestamp = now - 86400 * 1000;
15101508

1511-
geminiInstance.clearExpiredSummary();
1509+
mockChromeStorage({
1510+
summaryList: [{ name: "Place", clue: "" }],
1511+
timestamp: exactTimestamp,
1512+
favoriteList: [],
1513+
});
1514+
1515+
geminiInstance.clearExpiredSummary();
15121516

1513-
// Wait for the async storage callback to complete
1514-
await flushPromises();
1517+
// Wait for the async storage callback to complete
1518+
await flushPromises();
15151519

1516-
// Should not clear (exactly 24 hours is still valid - elapsedTime > 86400 is false)
1517-
expect(state.hasSummary).toBe(true);
1520+
// Should not clear (exactly 24 hours is still valid - elapsedTime > 86400 is false)
1521+
expect(state.hasSummary).toBe(true);
1522+
} finally {
1523+
dateNowSpy.mockRestore();
1524+
}
15181525
});
15191526

15201527
test("should handle video summary requests", async () => {

0 commit comments

Comments
 (0)