Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
unit(call): ensure previewing video
Browse files Browse the repository at this point in the history
  • Loading branch information
lemredd committed Nov 22, 2022
1 parent 65f7e89 commit d7013d5
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions components/consultation/call/self_participant.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { nextTick } from "vue"
import { shallowMount } from "@vue/test-utils"

import Component from "./self_participant.vue"
Expand Down Expand Up @@ -35,8 +36,8 @@ describe("Component: consultation/call/self participant", () => {
"props": {
"containerId": "something",
"isJoined": false,
"mustShowVideo": false,
"mustTransmitAudio": false
"isShowingVideo": true,
"isTransmittingAudio": false
}
})

Expand All @@ -45,5 +46,33 @@ describe("Component: consultation/call/self participant", () => {
.toEqual(`${userProfile.data.id}_${userProfile.data.name}`)
})

it.todo("can load tracks")
it("can preview video", async() => {
const userProfile = {
"data": {
"id": "1",
"name": "User A"
}
}
const wrapper = shallowMount(Component, {
"global": {
"provide": {
"pageContext": { "pageProps": {
userProfile
} }
}
},
"props": {
"containerId": "something",
"isJoined": false,
"isShowingVideo": true,
"isTransmittingAudio": false
}
})
const castWrapper = wrapper.vm as any
const previewVideo = wrapper.find(".preview-video")
await nextTick()

expect(castWrapper.previewVideo).toHaveProperty("srcObject", "mock source")
expect(previewVideo.attributes("autoplay")).toBeDefined()
})
})

0 comments on commit d7013d5

Please sign in to comment.