Skip to content

Commit

Permalink
Add unit test for getSubtrackCount
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaboleken committed Nov 26, 2024
1 parent 076db7a commit ff78507
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/test/js/webrtc_adaptor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2026,7 +2026,7 @@ describe("WebRTCAdaptor", function() {

});

it("getSubtracks", async function() {
it("getSubtrackCount", async function() {

let adaptor = new WebRTCAdaptor({
websocketURL: "ws://example.com",
Expand All @@ -2035,22 +2035,20 @@ describe("WebRTCAdaptor", function() {

let streamId = "roomId";
let role = "host";
let offset = 0;
let size = 10;
let status = "active";

let jsCmd = {
command: "getSubtracks",
command: "getSubtrackCount",
streamId: streamId,
role: role,
offset: offset,
size: size,
status: status,
};

let webSocketAdaptor = sinon.mock(adaptor.webSocketAdaptor);

let sendExpectation = webSocketAdaptor.expects("send").once().withArgs(JSON.stringify(jsCmd));

adaptor.getSubtracks(streamId, role, offset, size);
adaptor.getSubtrackCount(streamId, role, status);

sendExpectation.verify()

Expand Down

0 comments on commit ff78507

Please sign in to comment.