Skip to content

Commit 4643844

Browse files
committed
fix test does not provide focus if the selection method is unknown
Signed-off-by: Timo K <[email protected]>
1 parent 66f202a commit 4643844

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

spec/unit/matrixrtc/CallMembership.spec.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ describe("CallMembership", () => {
118118
expect(membership.getTransport(oldestMembership)).toBe(membershipTemplate.foci_preferred[0]);
119119
});
120120

121-
it("does not provide focus if the selection method is unknown", () => {
121+
it("gets the correct active transport with multi_sfu", () => {
122122
const membership = new CallMembership(makeMockEvent(), {
123123
...membershipTemplate,
124124
foci_preferred: [mockFocus],
@@ -131,6 +131,16 @@ describe("CallMembership", () => {
131131
// If there is an older member we still use our own focus in multi sfu.
132132
expect(membership.getTransport(oldestMembership)).toBe(mockFocus);
133133
});
134+
it("does not provide focus if the selection method is unknown", () => {
135+
const membership = new CallMembership(makeMockEvent(), {
136+
...membershipTemplate,
137+
foci_preferred: [mockFocus],
138+
focus_active: { type: "livekit", focus_selection: "unknown" },
139+
});
140+
141+
// if we are the oldest member we use our focus.
142+
expect(membership.getTransport(membership)).toBeUndefined();
143+
});
134144
});
135145
describe("correct values from computed fields", () => {
136146
const membership = new CallMembership(makeMockEvent(), membershipTemplate);

0 commit comments

Comments
 (0)