Tactical Media Broadcast Hub — initial release
Self-hosted multi-platform broadcast newsroom for activist collectives: publishing pipeline with group approval and DST-proof scheduling, TweetDeck-style column wall with hostile-content-safe rendering, live control room with Auto Director, bridged chat governance with polls and quorum, distributed sandboxed transcode workers, encrypted content-addressed archive, monthly analytics. MIT licensed. See README.md and docs/.
This commit is contained in:
commit
aa5e262f3a
880 changed files with 111042 additions and 0 deletions
44
packages/connector-mock-livestream/src/contract.test.ts
Normal file
44
packages/connector-mock-livestream/src/contract.test.ts
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
createMockLivestreamConnector,
|
||||
createMockLivestreamState,
|
||||
transitionMockLive,
|
||||
} from "./index.js";
|
||||
import {
|
||||
connectorContractTests,
|
||||
livestreamConnectorContractTests,
|
||||
} from "@tactical-media-broadcast-hub/connector-sdk/testing";
|
||||
import type { ConnectorConnection } from "@tactical-media-broadcast-hub/core";
|
||||
|
||||
const connection: ConnectorConnection = {
|
||||
id: "conn-live",
|
||||
workspaceId: "ws-1",
|
||||
provider: "mock-livestream",
|
||||
channelId: "ch-1",
|
||||
credentialId: { kind: "credential-ref", id: "cred-1" },
|
||||
fields: {},
|
||||
createdAt: new Date(),
|
||||
};
|
||||
|
||||
connectorContractTests(createMockLivestreamConnector(createMockLivestreamState()), { connection });
|
||||
livestreamConnectorContractTests(
|
||||
createMockLivestreamConnector(createMockLivestreamState()),
|
||||
{ connection },
|
||||
);
|
||||
|
||||
describe("mock-livestream scripted transitions", () => {
|
||||
it("state transitions are visible to the monitor side", async () => {
|
||||
const state = createMockLivestreamState();
|
||||
const connector = createMockLivestreamConnector(state);
|
||||
const live = await connector.createLiveStream?.(connection, {
|
||||
channelId: "ch-1",
|
||||
title: "fixture",
|
||||
permanent: false,
|
||||
saveReplay: false,
|
||||
});
|
||||
expect(live?.state).toBe("created");
|
||||
transitionMockLive(state, live!.remoteId, "live");
|
||||
const page = await connector.getLiveStreams?.(connection, { limit: 10 });
|
||||
expect(page?.items[0]?.state).toBe("live");
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue