mirror of
https://github.com/vector-im/element-call.git
synced 2026-09-01 21:25:18 +00:00
Refactor
This commit is contained in:
@@ -248,7 +248,7 @@ function withCallViewModel(
|
|||||||
}
|
}
|
||||||
|
|
||||||
test("participants are retained during a focus switch", () => {
|
test("participants are retained during a focus switch", () => {
|
||||||
withTestScheduler(({ cold, expectObservable }) => {
|
withTestScheduler(({ hot, expectObservable }) => {
|
||||||
// Participants disappear on frame 2 and come back on frame 3
|
// Participants disappear on frame 2 and come back on frame 3
|
||||||
const participantMarbles = "a-ba";
|
const participantMarbles = "a-ba";
|
||||||
// Start switching focus on frame 1 and reconnect on frame 3
|
// Start switching focus on frame 1 and reconnect on frame 3
|
||||||
@@ -257,12 +257,12 @@ test("participants are retained during a focus switch", () => {
|
|||||||
const layoutMarbles = " a";
|
const layoutMarbles = " a";
|
||||||
|
|
||||||
withCallViewModel(
|
withCallViewModel(
|
||||||
cold(participantMarbles, {
|
hot(participantMarbles, {
|
||||||
a: [aliceParticipant, bobParticipant],
|
a: [aliceParticipant, bobParticipant],
|
||||||
b: [],
|
b: [],
|
||||||
}),
|
}),
|
||||||
of([aliceRtcMember, bobRtcMember]),
|
of([aliceRtcMember, bobRtcMember]),
|
||||||
cold(connectionMarbles, {
|
hot(connectionMarbles, {
|
||||||
c: ConnectionState.Connected,
|
c: ConnectionState.Connected,
|
||||||
s: ECAddonConnectionState.ECSwitchingFocus,
|
s: ECAddonConnectionState.ECSwitchingFocus,
|
||||||
}),
|
}),
|
||||||
@@ -281,7 +281,7 @@ test("participants are retained during a focus switch", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("screen sharing activates spotlight layout", () => {
|
test("screen sharing activates spotlight layout", () => {
|
||||||
withTestScheduler(({ cold, schedule, expectObservable }) => {
|
withTestScheduler(({ hot, schedule, expectObservable }) => {
|
||||||
// Start with no screen shares, then have Alice and Bob share their screens,
|
// Start with no screen shares, then have Alice and Bob share their screens,
|
||||||
// then return to no screen shares, then have just Alice share for a bit
|
// then return to no screen shares, then have just Alice share for a bit
|
||||||
const participantMarbles = " abcda-ba";
|
const participantMarbles = " abcda-ba";
|
||||||
@@ -294,7 +294,7 @@ test("screen sharing activates spotlight layout", () => {
|
|||||||
const layoutMarbles = " abcdaefeg";
|
const layoutMarbles = " abcdaefeg";
|
||||||
const showSpeakingMarbles = "y----nyny";
|
const showSpeakingMarbles = "y----nyny";
|
||||||
withCallViewModel(
|
withCallViewModel(
|
||||||
cold(participantMarbles, {
|
hot(participantMarbles, {
|
||||||
a: [aliceParticipant, bobParticipant],
|
a: [aliceParticipant, bobParticipant],
|
||||||
b: [aliceSharingScreen, bobParticipant],
|
b: [aliceSharingScreen, bobParticipant],
|
||||||
c: [aliceSharingScreen, bobSharingScreen],
|
c: [aliceSharingScreen, bobSharingScreen],
|
||||||
@@ -417,7 +417,7 @@ test("participants stay in the same order unless to appear/disappear", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("spotlight speakers swap places", () => {
|
test("spotlight speakers swap places", () => {
|
||||||
withTestScheduler(({ cold, schedule, expectObservable }) => {
|
withTestScheduler(({ hot, schedule, expectObservable }) => {
|
||||||
// Go immediately into spotlight mode for the test
|
// Go immediately into spotlight mode for the test
|
||||||
const modeMarbles = " s";
|
const modeMarbles = " s";
|
||||||
// First Bob speaks, then Dave, then Alice
|
// First Bob speaks, then Dave, then Alice
|
||||||
@@ -435,9 +435,9 @@ test("spotlight speakers swap places", () => {
|
|||||||
of([aliceRtcMember, bobRtcMember, daveRtcMember]),
|
of([aliceRtcMember, bobRtcMember, daveRtcMember]),
|
||||||
of(ConnectionState.Connected),
|
of(ConnectionState.Connected),
|
||||||
new Map([
|
new Map([
|
||||||
[aliceParticipant, cold(aSpeakingMarbles, { y: true, n: false })],
|
[aliceParticipant, hot(aSpeakingMarbles, { y: true, n: false })],
|
||||||
[bobParticipant, cold(bSpeakingMarbles, { y: true, n: false })],
|
[bobParticipant, hot(bSpeakingMarbles, { y: true, n: false })],
|
||||||
[daveParticipant, cold(dSpeakingMarbles, { y: true, n: false })],
|
[daveParticipant, hot(dSpeakingMarbles, { y: true, n: false })],
|
||||||
]),
|
]),
|
||||||
(vm) => {
|
(vm) => {
|
||||||
schedule(modeMarbles, { s: () => vm.setGridMode("spotlight") });
|
schedule(modeMarbles, { s: () => vm.setGridMode("spotlight") });
|
||||||
|
|||||||
Reference in New Issue
Block a user