@webex/internal-plugin-presence 3.0.0-beta.12 → 3.0.0-beta.121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/presence.js CHANGED
@@ -21,7 +21,7 @@ const Presence = WebexPlugin.extend({
21
21
  namespace: 'Presence',
22
22
 
23
23
  children: {
24
- batcher: PresenceBatcher
24
+ batcher: PresenceBatcher,
25
25
  },
26
26
 
27
27
  session: {
@@ -29,8 +29,8 @@ const Presence = WebexPlugin.extend({
29
29
  default() {
30
30
  return new PresenceWorker();
31
31
  },
32
- type: 'any'
33
- }
32
+ type: 'any',
33
+ },
34
34
  },
35
35
 
36
36
  /**
@@ -62,7 +62,8 @@ const Presence = WebexPlugin.extend({
62
62
  * @returns {Promise<boolean>} resolves with true, if successful
63
63
  */
64
64
  enable() {
65
- return this.webex.internal.feature.setFeature(USER, USER_PRESENCE_ENABLED, true)
65
+ return this.webex.internal.feature
66
+ .setFeature(USER, USER_PRESENCE_ENABLED, true)
66
67
  .then((response) => response.value);
67
68
  },
68
69
 
@@ -71,7 +72,8 @@ const Presence = WebexPlugin.extend({
71
72
  * @returns {Promise<boolean>} resolves with false, if successful
72
73
  */
73
74
  disable() {
74
- return this.webex.internal.feature.setFeature(USER, USER_PRESENCE_ENABLED, false)
75
+ return this.webex.internal.feature
76
+ .setFeature(USER, USER_PRESENCE_ENABLED, false)
75
77
  .then((response) => response.value);
76
78
  },
77
79
 
@@ -113,17 +115,18 @@ const Presence = WebexPlugin.extend({
113
115
  return Promise.reject(new Error('A person id is required'));
114
116
  }
115
117
 
116
- return this.webex.request({
117
- method: 'GET',
118
- service: 'apheleia',
119
- resource: `compositions?userId=${personId}`
120
- })
118
+ return this.webex
119
+ .request({
120
+ method: 'GET',
121
+ service: 'apheleia',
122
+ resource: `compositions?userId=${personId}`,
123
+ })
121
124
  .then((response) => response.body);
122
125
  },
123
126
 
124
127
  /**
125
- * @typedef {Object} PresenceStatusesObject
126
- * @property {Array.<PresenceStatusObject>} statusList
128
+ * @typedef {Object} PresenceStatusesObject
129
+ * @property {Array.<PresenceStatusObject>} statusList
127
130
  */
128
131
  /**
129
132
  * Gets the current presence statuses of an array of people ids
@@ -135,9 +138,9 @@ const Presence = WebexPlugin.extend({
135
138
  return Promise.reject(new Error('An array of person ids is required'));
136
139
  }
137
140
 
138
- return Promise.all(personIds.map((id) =>
139
- this.batcher.request(id)))
140
- .then((presences) => ({statusList: presences}));
141
+ return Promise.all(personIds.map((id) => this.batcher.request(id))).then((presences) => ({
142
+ statusList: presences,
143
+ }));
141
144
  },
142
145
 
143
146
  /**
@@ -157,8 +160,7 @@ const Presence = WebexPlugin.extend({
157
160
  }
158
161
  if (Array.isArray(personIds)) {
159
162
  subjects = personIds;
160
- }
161
- else {
163
+ } else {
162
164
  subjects = [personIds];
163
165
  }
164
166
  // Limit batches to 50 ids per request
@@ -166,19 +168,22 @@ const Presence = WebexPlugin.extend({
166
168
  batches.push(subjects.slice(i, i + batchLimit));
167
169
  }
168
170
 
169
- return Promise.all(batches.map((ids) =>
170
- this.webex.request({
171
- method: 'POST',
172
- api: 'apheleia',
173
- resource: 'subscriptions',
174
- body: {
175
- subjects: ids,
176
- subscriptionTtl,
177
- includeStatus: true
178
- }
179
- })
180
- .then((response) => response.body.responses)))
181
- .then((idBatches) => ({responses: [].concat(...idBatches)}));
171
+ return Promise.all(
172
+ batches.map((ids) =>
173
+ this.webex
174
+ .request({
175
+ method: 'POST',
176
+ api: 'apheleia',
177
+ resource: 'subscriptions',
178
+ body: {
179
+ subjects: ids,
180
+ subscriptionTtl,
181
+ includeStatus: true,
182
+ },
183
+ })
184
+ .then((response) => response.body.responses)
185
+ )
186
+ ).then((idBatches) => ({responses: [].concat(...idBatches)}));
182
187
  },
183
188
 
184
189
  /**
@@ -194,8 +199,7 @@ const Presence = WebexPlugin.extend({
194
199
  }
195
200
  if (Array.isArray(personIds)) {
196
201
  subjects = personIds;
197
- }
198
- else {
202
+ } else {
199
203
  subjects = [personIds];
200
204
  }
201
205
 
@@ -206,8 +210,8 @@ const Presence = WebexPlugin.extend({
206
210
  body: {
207
211
  subjects,
208
212
  subscriptionTtl: 0,
209
- includeStatus: true
210
- }
213
+ includeStatus: true,
214
+ },
211
215
  });
212
216
  },
213
217
 
@@ -222,16 +226,17 @@ const Presence = WebexPlugin.extend({
222
226
  return Promise.reject(new Error('A status is required'));
223
227
  }
224
228
 
225
- return this.webex.request({
226
- method: 'POST',
227
- api: 'apheleia',
228
- resource: 'events',
229
- body: {
230
- subject: this.webex.internal.device.userId,
231
- eventType: status,
232
- ttl
233
- }
234
- })
229
+ return this.webex
230
+ .request({
231
+ method: 'POST',
232
+ api: 'apheleia',
233
+ resource: 'events',
234
+ body: {
235
+ subject: this.webex.internal.device.userId,
236
+ eventType: status,
237
+ ttl,
238
+ },
239
+ })
235
240
  .then((response) => response.body);
236
241
  },
237
242
 
@@ -251,7 +256,7 @@ const Presence = WebexPlugin.extend({
251
256
  */
252
257
  dequeue(id) {
253
258
  return this.worker.dequeue(id);
254
- }
259
+ },
255
260
  });
256
261
 
257
262
  export default Presence;
@@ -11,82 +11,91 @@ import testUsers from '@webex/test-helper-test-users';
11
11
  import {expectEvent} from '@webex/test-helper-mocha';
12
12
  import sinon from 'sinon';
13
13
 
14
- describe('plugin-presence', function () {
14
+ // SPARK-413317
15
+ describe.skip('plugin-presence', function () {
15
16
  this.timeout(10000);
16
17
  describe('Presence', () => {
17
18
  let mccoy, spock;
18
19
 
19
- beforeEach('create users', () => testUsers.create({count: 2})
20
- .then((users) => {
20
+ beforeEach('create users', () =>
21
+ testUsers.create({count: 2}).then((users) => {
21
22
  [spock, mccoy] = users;
22
23
  spock.webex = new WebexCore({
23
24
  credentials: {
24
- authorization: users[0].token
25
- }
25
+ authorization: users[0].token,
26
+ },
26
27
  });
27
28
  mccoy.webex = new WebexCore({
28
29
  credentials: {
29
- authorization: users[1].token
30
- }
30
+ authorization: users[1].token,
31
+ },
31
32
  });
32
- }));
33
+ })
34
+ );
33
35
 
34
- beforeEach('register with wdm', () => Promise.all([
35
- spock.webex.internal.device.register(),
36
- mccoy.webex.internal.device.register()
37
- ]));
36
+ beforeEach('register with wdm', () =>
37
+ Promise.all([spock.webex.internal.device.register(), mccoy.webex.internal.device.register()])
38
+ );
38
39
 
39
40
  beforeEach('register spock with mercury', () => spock.webex.internal.mercury.connect());
40
41
 
41
42
  afterEach('deregister spock with mercury', () => spock.webex.internal.mercury.disconnect());
42
43
 
43
44
  describe('#enable()', () => {
44
- it('enables presence', () => spock.webex.internal.presence.enable()
45
- .then((isEnabled) => {
46
- assert.equal(isEnabled, true);
47
- })
48
- .then(() => spock.webex.internal.presence.isEnabled())
49
- .then((isEnabled) => {
50
- assert.equal(isEnabled, true);
51
- }));
45
+ it('enables presence', () =>
46
+ spock.webex.internal.presence
47
+ .enable()
48
+ .then((isEnabled) => {
49
+ assert.equal(isEnabled, true);
50
+ })
51
+ .then(() => spock.webex.internal.presence.isEnabled())
52
+ .then((isEnabled) => {
53
+ assert.equal(isEnabled, true);
54
+ }));
52
55
  });
53
56
 
54
57
  describe('#disable()', () => {
55
- it('disables presence', () => spock.webex.internal.presence.disable()
56
- .then((isEnabled) => {
57
- assert.equal(isEnabled, false);
58
- })
59
- .then(() => spock.webex.internal.presence.isEnabled())
60
- .then((isEnabled) => {
61
- assert.equal(isEnabled, false);
62
- }));
58
+ it('disables presence', () =>
59
+ spock.webex.internal.presence
60
+ .disable()
61
+ .then((isEnabled) => {
62
+ assert.equal(isEnabled, false);
63
+ })
64
+ .then(() => spock.webex.internal.presence.isEnabled())
65
+ .then((isEnabled) => {
66
+ assert.equal(isEnabled, false);
67
+ }));
63
68
  });
64
69
 
65
70
  describe('#isEnabled()', () => {
66
- it('returns true when presence is enabled', () => spock.webex.internal.presence.enable()
67
- .then(() => spock.webex.internal.presence.isEnabled())
68
- .then((isEnabled) => {
69
- assert.equal(isEnabled, true);
70
- }));
71
+ it('returns true when presence is enabled', () =>
72
+ spock.webex.internal.presence
73
+ .enable()
74
+ .then(() => spock.webex.internal.presence.isEnabled())
75
+ .then((isEnabled) => {
76
+ assert.equal(isEnabled, true);
77
+ }));
71
78
 
72
- it('returns false when presence is disabled', () => spock.webex.internal.presence.disable()
73
- .then(() => spock.webex.internal.presence.isEnabled())
74
- .then((isEnabled) => {
75
- assert.equal(isEnabled, false);
76
- }));
79
+ it('returns false when presence is disabled', () =>
80
+ spock.webex.internal.presence
81
+ .disable()
82
+ .then(() => spock.webex.internal.presence.isEnabled())
83
+ .then((isEnabled) => {
84
+ assert.equal(isEnabled, false);
85
+ }));
77
86
  });
78
87
 
79
88
  describe('#get()', () => {
80
- it('gets a person\'s status by id', () => spock.webex.internal.presence.get(mccoy.id)
81
- .then((presenceResponse) => {
89
+ it("gets a person's status by id", () =>
90
+ spock.webex.internal.presence.get(mccoy.id).then((presenceResponse) => {
82
91
  assert.property(presenceResponse, 'subject');
83
92
  assert.equal(presenceResponse.subject, mccoy.id);
84
93
  }));
85
94
  });
86
95
 
87
96
  describe('#list()', () => {
88
- it('returns an object with the status of all requested people', () => spock.webex.internal.presence.list([mccoy.id, spock.id])
89
- .then((presenceResponse) => {
97
+ it('returns an object with the status of all requested people', () =>
98
+ spock.webex.internal.presence.list([mccoy.id, spock.id]).then((presenceResponse) => {
90
99
  assert.equal(presenceResponse.statusList.length, 2);
91
100
  assert.property(presenceResponse.statusList[0], 'subject');
92
101
  assert.equal(presenceResponse.statusList[0].subject, mccoy.id);
@@ -97,16 +106,18 @@ describe('plugin-presence', function () {
97
106
  describe('batching of presence requests', () => {
98
107
  let batchTestUsers;
99
108
 
100
- beforeEach('create more users', () => testUsers.create({count: 6})
101
- .then((users) => {
109
+ beforeEach('create more users', () =>
110
+ testUsers.create({count: 6}).then((users) => {
102
111
  batchTestUsers = users;
103
- }));
112
+ })
113
+ );
104
114
 
105
115
  it('executes network requests for max limit', () => {
106
116
  spock.webex.internal.presence.config.batcherMaxCalls = 2;
107
117
  sinon.spy(spock.webex.internal.presence.batcher, 'submitHttpRequest');
108
118
 
109
- return spock.webex.internal.presence.list(batchTestUsers.map((user) => user.id))
119
+ return spock.webex.internal.presence
120
+ .list(batchTestUsers.map((user) => user.id))
110
121
  .then((presenceResponse) => {
111
122
  assert.equal(presenceResponse.statusList.length, 6);
112
123
  assert.calledThrice(spock.webex.internal.presence.batcher.submitHttpRequest);
@@ -117,61 +128,87 @@ describe('plugin-presence', function () {
117
128
  });
118
129
 
119
130
  describe('#subscribe', () => {
120
- afterEach(() => spock && spock.webex && spock.webex.internal.presence.unsubscribe([mccoy.id, spock.id]));
131
+ afterEach(
132
+ () =>
133
+ spock && spock.webex && spock.webex.internal.presence.unsubscribe([mccoy.id, spock.id])
134
+ );
121
135
 
122
- it('subscribes to a person id and returns subscription status', () => spock.webex.internal.presence.subscribe(mccoy.id)
123
- .then((presenceResponse) => {
136
+ it('subscribes to a person id and returns subscription status', () =>
137
+ spock.webex.internal.presence.subscribe(mccoy.id).then((presenceResponse) => {
124
138
  assert.property(presenceResponse, 'responses');
125
139
  assert.equal(presenceResponse.responses.length, 1);
126
140
  assert.equal(presenceResponse.responses[0].subject, mccoy.id);
127
141
  }));
128
142
 
129
143
  it('subscribes and returns subscription status of a list of people ids', () =>
130
- spock.webex.internal.presence.subscribe([mccoy.id, spock.id])
131
- .then((presenceResponse) => {
132
- assert.property(presenceResponse, 'responses');
133
- assert.equal(presenceResponse.responses.length, 2);
134
- assert.equal(presenceResponse.responses[0].subject, mccoy.id);
135
- assert.equal(presenceResponse.responses[1].subject, spock.id);
136
- }));
144
+ spock.webex.internal.presence.subscribe([mccoy.id, spock.id]).then((presenceResponse) => {
145
+ assert.property(presenceResponse, 'responses');
146
+ assert.equal(presenceResponse.responses.length, 2);
147
+ assert.equal(presenceResponse.responses[0].subject, mccoy.id);
148
+ assert.equal(presenceResponse.responses[1].subject, spock.id);
149
+ }));
137
150
 
138
151
  // Note: The presence service no longer accepts setting status to "inactive".
139
152
  // Inactivity is now determined by a "last active time" of greater than 10 minutes.
140
- it('should receive a mercury event for a subscribed person\'s change', () =>
141
- spock.webex.internal.presence.subscribe(mccoy.id)
153
+ it("should receive a mercury event for a subscribed person's change", () =>
154
+ spock.webex.internal.presence
155
+ .subscribe(mccoy.id)
142
156
  // 'active' status
143
- .then(() => Promise.all([
144
- expectEvent(10000, 'event:apheleia.subscription_update', spock.webex.internal.mercury, 'spock should get the presence active event'),
145
- mccoy.webex.internal.presence.setStatus('active', 1500)
146
- ]))
147
- .then(([event]) => assert.equal(event.data.status, 'active', 'mccoy presence event status should be active'))
157
+ .then(() =>
158
+ Promise.all([
159
+ expectEvent(
160
+ 10000,
161
+ 'event:apheleia.subscription_update',
162
+ spock.webex.internal.mercury,
163
+ 'spock should get the presence active event'
164
+ ),
165
+ mccoy.webex.internal.presence.setStatus('active', 1500),
166
+ ])
167
+ )
168
+ .then(([event]) =>
169
+ assert.equal(
170
+ event.data.status,
171
+ 'active',
172
+ 'mccoy presence event status should be active'
173
+ )
174
+ )
148
175
  // 'dnd' status
149
- .then(() => Promise.all([
150
- expectEvent(10000, 'event:apheleia.subscription_update', spock.webex.internal.mercury, 'spock should get the presence dnd event'),
151
- mccoy.webex.internal.presence.setStatus('dnd', 1500)
152
- ]))
153
- .then(([event]) => assert.equal(event.data.status, 'dnd', 'mccoy presence event status should be dnd')));
176
+ .then(() =>
177
+ Promise.all([
178
+ expectEvent(
179
+ 10000,
180
+ 'event:apheleia.subscription_update',
181
+ spock.webex.internal.mercury,
182
+ 'spock should get the presence dnd event'
183
+ ),
184
+ mccoy.webex.internal.presence.setStatus('dnd', 1500),
185
+ ])
186
+ )
187
+ .then(([event]) =>
188
+ assert.equal(event.data.status, 'dnd', 'mccoy presence event status should be dnd')
189
+ ));
154
190
  });
155
191
 
156
192
  describe('#unsubscribe', () => {
157
193
  it('unsubscribes to presence updates of a single person id', () =>
158
- spock.webex.internal.presence.unsubscribe(mccoy.id)
194
+ spock.webex.internal.presence
195
+ .unsubscribe(mccoy.id)
159
196
  .then((res) => assert.statusCode(res, 200)));
160
197
 
161
198
  it('unsubscribes to presence updates of a list of people ids', () =>
162
- spock.webex.internal.presence.unsubscribe([mccoy.id, spock.id])
199
+ spock.webex.internal.presence
200
+ .unsubscribe([mccoy.id, spock.id])
163
201
  .then((res) => assert.statusCode(res, 200)));
164
202
  });
165
203
 
166
204
  describe('#setStatus', () => {
167
205
  it('sets the presence status of the current user', () =>
168
- spock.webex.internal.presence.setStatus('dnd', 1500)
169
- .then((statusResponse) => {
170
- assert.property(statusResponse, 'subject');
171
- assert.property(statusResponse, 'status');
172
- assert.equal(statusResponse.subject, spock.id);
173
- assert.equal(statusResponse.status, 'dnd');
174
- }));
206
+ spock.webex.internal.presence.setStatus('dnd', 1500).then((statusResponse) => {
207
+ assert.property(statusResponse, 'subject');
208
+ assert.property(statusResponse, 'status');
209
+ assert.equal(statusResponse.subject, spock.id);
210
+ assert.equal(statusResponse.status, 'dnd');
211
+ }));
175
212
  });
176
213
  });
177
214
  });
@@ -18,22 +18,18 @@ describe('presence-worker', () => {
18
18
  webex = new MockWebex({
19
19
  children: {
20
20
  mercury: Mercury,
21
- presence: Presence
22
- }
21
+ presence: Presence,
22
+ },
23
23
  });
24
24
  worker = new PresenceWorker();
25
25
  worker.webex = webex;
26
26
  });
27
27
 
28
28
  describe('#initialize()', () => {
29
- it('requires webex', () => assert.throws(
30
- worker.initialize,
31
- /Must initialize Presence Worker with webex!/
32
- ));
33
- it('requires webex internal', () => assert.throws(
34
- () => worker.initialize({}),
35
- /Must initialize Presence Worker with webex!/
36
- ));
29
+ it('requires webex', () =>
30
+ assert.throws(worker.initialize, /Must initialize Presence Worker with webex!/));
31
+ it('requires webex internal', () =>
32
+ assert.throws(() => worker.initialize({}), /Must initialize Presence Worker with webex!/));
37
33
  });
38
34
 
39
35
  describe('#enqueue()', () => {
@@ -119,12 +115,11 @@ describe('presence-worker', () => {
119
115
  const boarding = {
120
116
  pam: true,
121
117
  jim: true,
122
- dwight: true
118
+ dwight: true,
123
119
  };
124
120
 
125
121
  it('moves fetchers to flights', () => {
126
- webex.internal.presence.list = sinon.stub()
127
- .returns(Promise.resolve({statusList: []}));
122
+ webex.internal.presence.list = sinon.stub().returns(Promise.resolve({statusList: []}));
128
123
 
129
124
  worker.fetchers = boarding;
130
125
 
@@ -134,13 +129,10 @@ describe('presence-worker', () => {
134
129
  });
135
130
 
136
131
  it('calls presence.list', async () => {
137
- const response = [
138
- {subject: 'pam'},
139
- {subject: 'jim'},
140
- {subject: 'dwight'}
141
- ];
132
+ const response = [{subject: 'pam'}, {subject: 'jim'}, {subject: 'dwight'}];
142
133
 
143
- webex.internal.presence.list = sinon.stub()
134
+ webex.internal.presence.list = sinon
135
+ .stub()
144
136
  .returns(Promise.resolve({statusList: response}));
145
137
  webex.internal.presence.emitEvent = sinon.stub();
146
138
 
@@ -151,9 +143,10 @@ describe('presence-worker', () => {
151
143
  assert.calledWith(webex.internal.presence.list, Object.keys(boarding));
152
144
  assert.isEmpty(worker.flights);
153
145
  assert.deepEqual(Object.keys(worker.presences), Object.keys(boarding));
154
- assert.calledWith(webex.internal.presence.emitEvent,
155
- 'updated',
156
- {type: 'presence', payload: {statusList: response}});
146
+ assert.calledWith(webex.internal.presence.emitEvent, 'updated', {
147
+ type: 'presence',
148
+ payload: {statusList: response},
149
+ });
157
150
  });
158
151
  });
159
152
 
@@ -163,7 +156,7 @@ describe('presence-worker', () => {
163
156
  const scouts = {
164
157
  pam: now - 60001, // move them back a little over a minute
165
158
  jim: now - 60001,
166
- dwight: now
159
+ dwight: now,
167
160
  };
168
161
 
169
162
  worker.campers = scouts;
@@ -180,11 +173,11 @@ describe('presence-worker', () => {
180
173
  const subbies = {
181
174
  pam: now,
182
175
  jim: now + 61000, // move forward a little over a minute
183
- dwight: now
176
+ dwight: now,
184
177
  };
185
178
  const watching = {
186
179
  pam: 1,
187
- jim: 1
180
+ jim: 1,
188
181
  };
189
182
 
190
183
  worker.watchers = watching;
@@ -200,7 +193,7 @@ describe('presence-worker', () => {
200
193
  const subbies = {
201
194
  pam: now + 600000, // move forward 10 minutes
202
195
  jim: now - 20000, // move back 20 seconds
203
- dwight: now - 60000 // move back 1 minute
196
+ dwight: now - 60000, // move back 1 minute
204
197
  };
205
198
 
206
199
  worker.subscribers = subbies;
@@ -218,7 +211,7 @@ describe('presence-worker', () => {
218
211
  const presences = {
219
212
  pam: now - 300000, // 5 minutes ago
220
213
  jim: now - 600001, // little over 10 minutes ago
221
- dwight: now - 1200000 // 20 minutes ago
214
+ dwight: now - 1200000, // 20 minutes ago
222
215
  };
223
216
 
224
217
  webex.internal.presence.emitEvent = sinon.stub();
@@ -226,30 +219,33 @@ describe('presence-worker', () => {
226
219
 
227
220
  worker.cleanPresences();
228
221
 
229
- assert.calledWith(webex.internal.presence.emitEvent,
230
- 'updated',
231
- {type: 'delete', payload: ['jim', 'dwight']});
222
+ assert.calledWith(webex.internal.presence.emitEvent, 'updated', {
223
+ type: 'delete',
224
+ payload: ['jim', 'dwight'],
225
+ });
232
226
  });
233
227
  });
234
228
 
235
229
  describe('#groundskeeper()', () => {
236
230
  it('renews subscriptions', async () => {
237
- webex.internal.presence.subscribe = sinon.stub()
238
- .returns(Promise.resolve({
231
+ webex.internal.presence.subscribe = sinon.stub().returns(
232
+ Promise.resolve({
239
233
  responses: [
240
234
  {
241
235
  responseCode: 200,
242
236
  subscriptionTtl: 600,
243
237
  subject: 'pam',
244
238
  status: {
245
- subject: 'pam'
246
- }
239
+ subject: 'pam',
240
+ },
247
241
  },
248
242
  {
249
243
  responseCode: 500,
250
- subject: 'jim'
251
- }]
252
- }));
244
+ subject: 'jim',
245
+ },
246
+ ],
247
+ })
248
+ );
253
249
  worker.checkCampers = sinon.stub().returns(['pam']);
254
250
  worker.checkSubscriptions = sinon.stub().returns(['jim']);
255
251
  worker.cleanPresences = sinon.stub();
@@ -14,23 +14,30 @@ describe('plugin-presence', () => {
14
14
  beforeEach(() => {
15
15
  webex = new MockWebex({
16
16
  children: {
17
- presence: Presence
18
- }
17
+ presence: Presence,
18
+ },
19
19
  });
20
20
  });
21
21
 
22
22
  describe('#get()', () => {
23
- it('requires a person id parameter', () => assert.isRejected(webex.internal.presence.get(), /A person id is required/));
23
+ it('requires a person id parameter', () =>
24
+ assert.isRejected(webex.internal.presence.get(), /A person id is required/));
24
25
  });
25
26
 
26
27
  describe('#list()', () => {
27
- it('requires a parameter', () => assert.isRejected(webex.internal.presence.list(), /An array of person ids is required/));
28
+ it('requires a parameter', () =>
29
+ assert.isRejected(webex.internal.presence.list(), /An array of person ids is required/));
28
30
 
29
- it('requires a person array parameter', () => assert.isRejected(webex.internal.presence.list('abc'), /An array of person ids is required/));
31
+ it('requires a person array parameter', () =>
32
+ assert.isRejected(
33
+ webex.internal.presence.list('abc'),
34
+ /An array of person ids is required/
35
+ ));
30
36
  });
31
37
 
32
38
  describe('#subscribe()', () => {
33
- it('requires a person parameter', () => assert.isRejected(webex.internal.presence.subscribe(), /A person id is required/));
39
+ it('requires a person parameter', () =>
40
+ assert.isRejected(webex.internal.presence.subscribe(), /A person id is required/));
34
41
  it('subscription request called twice with batch of 100 ids', () => {
35
42
  const ids = [...Array(100).keys()];
36
43
 
@@ -38,7 +45,7 @@ describe('plugin-presence', () => {
38
45
  return Promise.resolve({
39
46
  statusCode: 204,
40
47
  body: [],
41
- options
48
+ options,
42
49
  });
43
50
  };
44
51
  sinon.spy(webex, 'request');
@@ -49,11 +56,13 @@ describe('plugin-presence', () => {
49
56
  });
50
57
 
51
58
  describe('#unsubscribe()', () => {
52
- it('requires a person parameter', () => assert.isRejected(webex.internal.presence.unsubscribe(), /A person id is required/));
59
+ it('requires a person parameter', () =>
60
+ assert.isRejected(webex.internal.presence.unsubscribe(), /A person id is required/));
53
61
  });
54
62
 
55
63
  describe('#setStatus()', () => {
56
- it('requires a status', () => assert.isRejected(webex.internal.presence.setStatus(), /A status is required/));
64
+ it('requires a status', () =>
65
+ assert.isRejected(webex.internal.presence.setStatus(), /A status is required/));
57
66
  });
58
67
  });
59
68
  });