Skip to content

Commit

Permalink
fix(plugin-meetings): add space_share call type to isMeetingActive (#…
Browse files Browse the repository at this point in the history
…4045)

Co-authored-by: shnaaz <82164376+shnaaz@users.noreply.github.com>
  • Loading branch information
dominiccarrington and shnaaz authored Feb 24, 2025
1 parent f5f2b13 commit 9abc67c
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 61 deletions.
1 change: 1 addition & 0 deletions packages/@webex/plugin-meetings/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export const _ON_HOLD_LOBBY_ = 'ON_HOLD_LOBBY';
export const _MEETING_LINK_ = 'MEETING_LINK';
export const _MEETING_UUID_ = 'MEETING_UUID';
export const _MEETING_ = 'MEETING';
export const _SPACE_SHARE_ = 'SPACE_SHARE';
export const _MEETING_CENTER_ = 'MEETING_CENTER';
export const _MEETING_ID_ = 'MEETING_ID';

Expand Down
4 changes: 3 additions & 1 deletion packages/@webex/plugin-meetings/src/locus-info/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
_SIP_BRIDGE_,
MEETING_STATE,
_MEETING_,
_SPACE_SHARE_,
LOCUSINFO,
LOCUS,
_LEFT_,
Expand Down Expand Up @@ -489,7 +490,8 @@ export default class LocusInfo extends EventsScope {
isMeetingActive() {
if (
this.parsedLocus.fullState.type === _CALL_ ||
this.parsedLocus.fullState.type === _SIP_BRIDGE_
this.parsedLocus.fullState.type === _SIP_BRIDGE_ ||
this.parsedLocus.fullState.type === _SPACE_SHARE_
) {
// @ts-ignore
const partner = this.getLocusPartner(this.participants, this.self);
Expand Down
130 changes: 70 additions & 60 deletions packages/@webex/plugin-meetings/test/unit/spec/locus-info/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'jsdom-global/register';
import sinon from 'sinon';
import {cloneDeep} from 'lodash';
import {cloneDeep, forEach} from 'lodash';
import {assert} from '@webex/test-helper-chai';
import MockWebex from '@webex/test-helper-mock-webex';
import testUtils from '../../../utils/testUtils';
Expand All @@ -23,6 +23,8 @@ import {
LOCUS,
MEETING_STATE,
_MEETING_,
_SIP_BRIDGE_,
_SPACE_SHARE_,
} from '../../../../src/constants';

import {self, selfWithInactivity} from './selfConstant';
Expand Down Expand Up @@ -102,7 +104,11 @@ describe('plugin-meetings', () => {
},
entryExitTone: {enabled: true, mode: 'foo'},
video: {enabled: true},
videoLayout: {overrideDefault: true, lockAttendeeViewOnStageOnly:false, stageParameters: {}},
videoLayout: {
overrideDefault: true,
lockAttendeeViewOnStageOnly: false,
stageParameters: {},
},
webcastControl: {streaming: false},
practiceSession: {enabled: true},
};
Expand Down Expand Up @@ -529,7 +535,7 @@ describe('plugin-meetings', () => {
manualCaptionControl: {enabled: false},
};

locusInfo.updateControls({manualCaptionControl: { enabled: true, }});
locusInfo.updateControls({manualCaptionControl: {enabled: true}});

assert.calledWith(
locusInfo.emitScoped,
Expand Down Expand Up @@ -2636,65 +2642,69 @@ describe('plugin-meetings', () => {
});

describe('#isMeetingActive', () => {
it('sends client event correctly for state = inactive', () => {
locusInfo.parsedLocus = {
fullState: {
type: _CALL_,
},
};

locusInfo.fullState = {
state: LOCUS.STATE.INACTIVE,
};

locusInfo.isMeetingActive();

assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
name: 'client.call.remote-ended',
options: {
meetingId: locusInfo.meetingId,
},
});
});

it('sends client event correctly for state = PARTNER_LEFT', () => {
locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
locusInfo.parsedLocus = {
fullState: {
type: _CALL_,
},
self: {
state: MEETING_STATE.STATES.DECLINED,
},
};
locusInfo.isMeetingActive();

assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
name: 'client.call.remote-ended',
options: {
meetingId: locusInfo.meetingId,
},
});
});

it('sends client event correctly for state = SELF_LEFT', () => {
locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
locusInfo.parsedLocus = {
fullState: {
type: _CALL_,
},
self: {
state: MEETING_STATE.STATES.LEFT,
},
};
forEach([_CALL_, _SIP_BRIDGE_, _SPACE_SHARE_], (type) => {
describe(`type = ${type}`, () => {
it('sends client event correctly for state = inactive', () => {
locusInfo.parsedLocus = {
fullState: {
type: type,
},
};

locusInfo.fullState = {
state: LOCUS.STATE.INACTIVE,
};

locusInfo.isMeetingActive();

assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
name: 'client.call.remote-ended',
options: {
meetingId: locusInfo.meetingId,
},
});
});

locusInfo.isMeetingActive();
it('sends client event correctly for state = PARTNER_LEFT', () => {
locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
locusInfo.parsedLocus = {
fullState: {
type: type,
},
self: {
state: MEETING_STATE.STATES.DECLINED,
},
};
locusInfo.isMeetingActive();

assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
name: 'client.call.remote-ended',
options: {
meetingId: locusInfo.meetingId,
},
});
});

assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
name: 'client.call.remote-ended',
options: {
meetingId: locusInfo.meetingId,
},
it('sends client event correctly for state = SELF_LEFT', () => {
locusInfo.getLocusPartner = sinon.stub().returns({state: MEETING_STATE.STATES.LEFT});
locusInfo.parsedLocus = {
fullState: {
type: type,
},
self: {
state: MEETING_STATE.STATES.LEFT,
},
};

locusInfo.isMeetingActive();

assert.calledWith(webex.internal.newMetrics.submitClientEvent, {
name: 'client.call.remote-ended',
options: {
meetingId: locusInfo.meetingId,
},
});
});
});
});

Expand Down

0 comments on commit 9abc67c

Please sign in to comment.