Files
buzz-sheet/lib/commission/message-event.test.ts
T
gunshiz 3473b55768
CI / Verify (push) Successful in 1m48s
CI / Build immutable images and deploy (push) Successful in 2m47s
feat(commission) : add push notifications and unread ticket titles
2026-10-02 11:51:05 +07:00

13 lines
629 B
TypeScript

import { describe, expect, it } from "vitest";
import { parseCommissionMessageEvent } from "./message-event";
describe("commission message events", () => {
it("accepts a new message and ignores other refresh events", () => {
const message = { messageId: "message-1", ticketId: "ticket-1", ticketTitle: "Build help",
authorId: "admin-1", authorName: "Admin", text: "Hello" };
expect(parseCommissionMessageEvent(`message:${JSON.stringify(message)}`)).toEqual(message);
expect(parseCommissionMessageEvent("changed")).toBeNull();
expect(parseCommissionMessageEvent("message:not-json")).toBeNull();
});
});