From 725b65b3e1a6f06b240e933e5b0f9e254968b2a6 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 10 Jul 2026 20:38:30 +0000 Subject: [PATCH] test: add missing edge case test for invalid update values Added a test case for `store.update` that verifies the state remains unchanged when invalid parameters like `null` or a string are passed. This improves the test coverage and ensures the behavior defined in `dispatchUpdate` remains reliable. Co-authored-by: johnstrand <11484777+johnstrand@users.noreply.github.com> --- src/__tests__/Squawk.update.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/__tests__/Squawk.update.test.ts b/src/__tests__/Squawk.update.test.ts index ced1a93..5ff8a76 100644 --- a/src/__tests__/Squawk.update.test.ts +++ b/src/__tests__/Squawk.update.test.ts @@ -28,4 +28,23 @@ describe("Squawk update", () => { prop2: "updated2" }); }); + + it("ignores invalid update values", () => { + const store = createStore({ + prop1: "initial1", + prop2: "initial2" + }); + + store.update(null as any); + expect(store.get()).toEqual({ + prop1: "initial1", + prop2: "initial2" + }); + + store.update("string" as any); + expect(store.get()).toEqual({ + prop1: "initial1", + prop2: "initial2" + }); + }); });