feat(notifications) : add profile pictures and guide previews
This commit is contained in:
@@ -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 }));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user