| 1 | import { beforeEach, describe, expect, it } from "vite-plus/test"; |
| 2 | |
| 3 | import { removeLocalStorageItem } from "./hooks/useLocalStorage"; |
| 4 | import { |
| 5 | dismissProviderUpdateNotification, |
| 6 | isProviderUpdateNotificationDismissed, |
| 7 | PROVIDER_UPDATE_DISMISSALS_STORAGE_KEY, |
| 8 | } from "./providerUpdateDismissal"; |
| 9 | |
| 10 | describe("providerUpdateDismissal", () => { |
| 11 | beforeEach(() => { |
| 12 | removeLocalStorageItem(PROVIDER_UPDATE_DISMISSALS_STORAGE_KEY); |
| 13 | }); |
| 14 | |
| 15 | it("persists provider update dismissals by notification key", () => { |
| 16 | expect(isProviderUpdateNotificationDismissed("opencode:1.14.33")).toBe(false); |
| 17 | |
| 18 | dismissProviderUpdateNotification("opencode:1.14.33"); |
| 19 | |
| 20 | expect(isProviderUpdateNotificationDismissed("opencode:1.14.33")).toBe(true); |
| 21 | expect(isProviderUpdateNotificationDismissed("opencode:1.14.34")).toBe(false); |
| 22 | }); |
| 23 | }); |