Spaces:
Paused
Paused
Download console/src/utils/inboxEvents.test.ts from mysticaldragon/HF: direct link, hf CLI and curl.
- Browser
- Download file 999 Bytes
-
https://huggingface.co/spaces/mysticaldragon/HF/resolve/main/console/src/utils/inboxEvents.test.ts
- Command line
-
hf download hf://spaces/mysticaldragon/HF/console/src/utils/inboxEvents.test.ts
-
curl -L -o inboxEvents.test.ts https://huggingface.co/spaces/mysticaldragon/HF/resolve/main/console/src/utils/inboxEvents.test.ts
999 Bytes
| import { describe, expect, it } from "vitest"; | |
| import type { InboxEvent } from "../api/modules/console"; | |
| import { INBOX_EVENT_QUERY_LIMIT, isPushMessageEvent } from "./inboxEvents"; | |
| function event(sourceType: string): InboxEvent { | |
| return { | |
| id: sourceType, | |
| agent_id: "default", | |
| source_type: sourceType, | |
| source_id: "source", | |
| event_type: "test", | |
| status: "success", | |
| severity: "info", | |
| title: "Test", | |
| body: "Test", | |
| read: false, | |
| created_at: 1, | |
| }; | |
| } | |
| describe("inboxEvents", () => { | |
| it("uses the shared page size for inbox counters", () => { | |
| expect(INBOX_EVENT_QUERY_LIMIT).toBe(200); | |
| }); | |
| it("matches the push-message sources shown by the Inbox", () => { | |
| expect( | |
| ["cron", "heartbeat", "memory", "skill_autoupdate"].every((source) => | |
| isPushMessageEvent(event(source)), | |
| ), | |
| ).toBe(true); | |
| expect(isPushMessageEvent(event("approval"))).toBe(false); | |
| expect(isPushMessageEvent(event("manual"))).toBe(false); | |
| }); | |
| }); | |