feat(notifications) : add profile pictures and guide previews

This commit is contained in:
2026-10-12 23:58:58 +07:00 Unverified
parent 05350e7aab
commit 28517d9b29
10 changed files with 178 additions and 16 deletions
@@ -38,4 +38,10 @@ describe("reply notification navigation", () => {
handlers.notificationclick({ notification: { close: vi.fn(), data: { url: "https://evil.example" } }, waitUntil: vi.fn() });
expect(self.clients.openWindow).not.toHaveBeenCalled();
});
it("displays the comment author's profile picture supplied by the push sender", () => {
const { self, handlers } = worker();
const icon = "https://profile.example/author.png";
handlers.push({ data: { json: () => ({ id: "comment-id", title: "New comment", body: "Text", icon, url: "/admin/comments" }) }, waitUntil: () => {} });
expect(self.registration.showNotification).toHaveBeenCalledWith("New comment", expect.objectContaining({ icon }));
});
});