This commit is contained in:
Nathan Flurry 2026-03-16 00:41:53 -07:00
parent aa332307e5
commit b372383cfd
47 changed files with 1845 additions and 1212 deletions

View file

@ -1,15 +1,9 @@
import { describe, expect, it } from "vitest";
import { auditLogKey, organizationKey, repositoryKey, taskKey, taskSandboxKey } from "../src/keys.js";
import { auditLogKey, organizationKey, taskKey, taskSandboxKey } from "../src/keys.js";
describe("actor keys", () => {
it("prefixes every key with organization namespace", () => {
const keys = [
organizationKey("default"),
repositoryKey("default", "repo"),
taskKey("default", "repo", "task"),
taskSandboxKey("default", "sbx"),
auditLogKey("default", "repo"),
];
const keys = [organizationKey("default"), taskKey("default", "repo", "task"), taskSandboxKey("default", "sbx"), auditLogKey("default")];
for (const key of keys) {
expect(key[0]).toBe("org");

View file

@ -164,6 +164,9 @@ describe("RemoteSubscriptionManager", () => {
},
} satisfies OrganizationEvent);
// applyEvent chains onto an internal promise — flush the microtask queue
await flushAsyncWork();
expect(manager.getSnapshot("organization", params)?.taskSummaries[0]?.title).toBe("Updated task");
expect(listenerA).toHaveBeenCalled();
expect(listenerB).toHaveBeenCalled();