Merge branch 'livekit' into test-components
This commit is contained in:
@@ -1,17 +1,8 @@
|
||||
/*
|
||||
Copyright 2024 New Vector Ltd
|
||||
Copyright 2024 New Vector Ltd.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { expect, test, vi } from "vitest";
|
||||
@@ -24,7 +15,7 @@ import {
|
||||
|
||||
test("set a participant's volume", async () => {
|
||||
const setVolumeSpy = vi.fn();
|
||||
await withRemoteMedia({}, { setVolume: setVolumeSpy }, async (vm) =>
|
||||
await withRemoteMedia({}, { setVolume: setVolumeSpy }, (vm) =>
|
||||
withTestScheduler(({ expectObservable, schedule }) => {
|
||||
schedule("-a|", {
|
||||
a() {
|
||||
@@ -39,7 +30,7 @@ test("set a participant's volume", async () => {
|
||||
|
||||
test("mute and unmute a participant", async () => {
|
||||
const setVolumeSpy = vi.fn();
|
||||
await withRemoteMedia({}, { setVolume: setVolumeSpy }, async (vm) =>
|
||||
await withRemoteMedia({}, { setVolume: setVolumeSpy }, (vm) =>
|
||||
withTestScheduler(({ expectObservable, schedule }) => {
|
||||
schedule("-abc|", {
|
||||
a() {
|
||||
@@ -65,7 +56,7 @@ test("mute and unmute a participant", async () => {
|
||||
});
|
||||
|
||||
test("toggle fit/contain for a participant's video", async () => {
|
||||
await withRemoteMedia({}, {}, async (vm) =>
|
||||
await withRemoteMedia({}, {}, (vm) =>
|
||||
withTestScheduler(({ expectObservable, schedule }) => {
|
||||
schedule("-ab|", {
|
||||
a: () => vm.toggleFitContain(),
|
||||
@@ -81,14 +72,14 @@ test("toggle fit/contain for a participant's video", async () => {
|
||||
});
|
||||
|
||||
test("local media remembers whether it should always be shown", async () => {
|
||||
await withLocalMedia({}, async (vm) =>
|
||||
await withLocalMedia({}, (vm) =>
|
||||
withTestScheduler(({ expectObservable, schedule }) => {
|
||||
schedule("-a|", { a: () => vm.setAlwaysShow(false) });
|
||||
expectObservable(vm.alwaysShow).toBe("ab", { a: true, b: false });
|
||||
}),
|
||||
);
|
||||
// Next local media should start out *not* always shown
|
||||
await withLocalMedia({}, async (vm) =>
|
||||
await withLocalMedia({}, (vm) =>
|
||||
withTestScheduler(({ expectObservable, schedule }) => {
|
||||
schedule("-a|", { a: () => vm.setAlwaysShow(true) });
|
||||
expectObservable(vm.alwaysShow).toBe("ab", { a: false, b: true });
|
||||
|
||||
Reference in New Issue
Block a user