Skip to content

Commit

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

});

it("getSubtracks", async function() {

let adaptor = new WebRTCAdaptor({
websocketURL: "ws://example.com",
isPlayMode: true
});

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

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

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

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

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

sendExpectation.verify()

});



});

0 comments on commit 076db7a

Please sign in to comment.