@@ -10,7 +10,6 @@ import {
|
10 | 10 | listWebPushSubscriptions, |
11 | 11 | registerWebPushSubscription, |
12 | 12 | resolveVapidKeys, |
13 | | -sendWebPushNotification, |
14 | 13 | } from "./push-web.js"; |
15 | 14 | |
16 | 15 | // Stub resolveStateDir so tests use a temp directory. |
@@ -162,25 +161,6 @@ describe("subscription CRUD", () => {
|
162 | 161 | describe("sending", () => { |
163 | 162 | const keys = { p256dh: "p256dh-key", auth: "auth-key" }; |
164 | 163 | |
165 | | -it("configures VAPID details for direct sends", async () => { |
166 | | -const sub = await registerWebPushSubscription({ |
167 | | -endpoint: "https://push.example.com/direct", |
168 | | - keys, |
169 | | -baseDir: tmpDir, |
170 | | -}); |
171 | | - |
172 | | -const result = await sendWebPushNotification(sub, { title: "Direct" }); |
173 | | - |
174 | | -expect(result.ok).toBe(true); |
175 | | -expect(vi.mocked(webPush.setVapidDetails)).toHaveBeenCalledTimes(1); |
176 | | -expect(vi.mocked(webPush.setVapidDetails)).toHaveBeenCalledWith( |
177 | | -"https://openclaw.ai", |
178 | | -"test-public-key-base64url", |
179 | | -"test-private-key-base64url", |
180 | | -); |
181 | | -expect(vi.mocked(webPush.sendNotification)).toHaveBeenCalledTimes(1); |
182 | | -}); |
183 | | - |
184 | 164 | it("configures VAPID details once before broadcasting to subscribers", async () => { |
185 | 165 | await registerWebPushSubscription({ |
186 | 166 | endpoint: "https://push.example.com/a", |
|