Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
gioelecerati committed Dec 7, 2023
1 parent 2982a93 commit eedb417
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion packages/api/src/controllers/stream.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ describe("controllers/stream", () => {
});
});

it("should create a stream, delete it, and error when attempting additional detele or replace", async () => {
it("should create a stream, delete it, and error when attempting additional delete or replace", async () => {
const res = await client.post("/stream", { ...postMockStream });
expect(res.status).toBe(201);
const stream = await res.json();
Expand Down Expand Up @@ -506,6 +506,26 @@ describe("controllers/stream", () => {
}
});

it("should create a stream and add a multistream target for it", async () => {
const res = await client.post("/stream", { ...postMockStream });
expect(res.status).toBe(201);
const stream = await res.json();
expect(stream.id).toBeDefined();

const document = await server.store.get(`stream/${stream.id}`);
expect(server.db.stream.addDefaultFields(document)).toEqual(stream);

const res2 = await client.post(
`/stream/${stream.id}/create-multistream-target`,
{
profile: "source",
videoOnly: false,
spec: { name: "target-name", url: "rtmp://test/test" },
}
);
expect(res2.status).toBe(204);
});

describe("set active and heartbeat", () => {
const callSetActive = async (
streamId: string,
Expand Down

0 comments on commit eedb417

Please sign in to comment.