Files
fusion/plugins/fusion-plugin-even-realities-glasses/src/__tests__/cards.test.ts
Fusion 089c139bad feat(FN-3743): add polling task notifications for even realities plugin
Commits merged:
- feat(FN-3743): add polling task notifications for even realities plugin

Files changed:
.../fusion-plugin-even-realities-glasses/README.md |  27 +++
 .../package.json                                   |   2 +
 .../src/__tests__/cards.test.ts                    |  82 +++------
 .../src/__tests__/diff.test.ts                     |  76 ++++++++
 .../src/__tests__/notification-card.test.ts        |  40 +++++
 .../src/__tests__/notification-routes.test.ts      |  78 ++++++++
 .../src/__tests__/notification-store.test.ts       |  71 ++++++++
 .../src/__tests__/notifier.test.ts                 | 138 +++++++++-----
 .../src/__tests__/transport.test.ts                |   4 +-
 .../src/agent-actions.ts                           |   4 +-
 .../src/cards.ts                                   | 127 ++++++++++---
 .../src/index.ts                                   |  22 ++-
 .../src/notifications/diff.ts                      |  77 ++++++++
 .../src/notifications/store.ts                     |  46 +++++
 .../src/notifications/types.ts                     |  19 ++
 .../src/notifier.ts                                | 199 +++++++++++++--------
 .../src/routes/notification-routes.ts              | 103 +++++++++++
 pnpm-lock.yaml                                     |  31 +++-
 18 files changed, 929 insertions(+), 217 deletions(-)

Fusion-Task-Id: FN-3743
2026-05-08 16:35:22 -07:00

35 lines
923 B
TypeScript

import { describe, expect, it } from "vitest";
import { boardSummaryCard, notificationCard, taskToCard } from "../cards.js";
const task = {
id: "FN-1",
title: "Ship",
description: "desc",
column: "in-review",
updatedAt: "2026-01-01T00:00:00.000Z",
dependencies: [],
steps: [],
currentStep: 1,
log: [],
} as any;
describe("cards", () => {
it("maps task to card", () => {
const card = taskToCard(task);
expect(card.kind).toBe("task");
expect(card.badge).toBe("in-review");
expect(card.taskId).toBe("FN-1");
});
it("creates board summary", () => {
const card = boardSummaryCard({ todo: 2, done: 1 });
expect(card.lines).toContain("todo: 2");
});
it("creates notification cards", () => {
const card = notificationCard(task, "entered-column");
expect(card.id).toBe("notif:FN-1:entered-column");
expect(card.title.startsWith("In review")).toBe(true);
});
});