@webex/internal-plugin-conversation 2.59.8 → 2.60.0-next.2

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.
@@ -154,6 +154,7 @@ describe('plugin-conversation', function () {
154
154
  scr: {
155
155
  loc: makeLocalUrl('/sample-image-small-one.png'),
156
156
  },
157
+ url: makeLocalUrl('/sample-image-small-one.png')
157
158
  })
158
159
  .then((f) =>
159
160
  fh.isMatchingFile(f, sampleImageSmallOnePng).then((result) => assert.isTrue(result))
@@ -467,7 +468,8 @@ describe('plugin-conversation', function () {
467
468
  }));
468
469
  });
469
470
 
470
- describe('with conversation from remote clusters', () => {
471
+ // SPARK-413317
472
+ describe.skip('with conversation from remote clusters', () => {
471
473
  let conversation3, conversation4;
472
474
 
473
475
  before('create conversations in EU cluster', () =>
@@ -959,7 +961,7 @@ describe('plugin-conversation', function () {
959
961
  .then(({edit}) => {
960
962
  assert.include(edit, parent.id);
961
963
  }));
962
-
964
+
963
965
  it('retrieves parent IDs for reactions', () =>
964
966
  webex.internal.conversation
965
967
  .addReaction(conversation, 'heart', parent)
@@ -34,6 +34,88 @@ describe('plugin-conversation', () => {
34
34
  webex.internal.services.getServiceUrlFromClusterId = sinon.stub().returns(convoUrl);
35
35
  });
36
36
 
37
+ describe('addReaction()', () => {
38
+ it('should add recipients to the payload if provided', () => {
39
+ const {conversation} = webex.internal;
40
+ const recipientId = 'example-recipient-id';
41
+ const expected = {items: [{id: recipientId, objectType: 'person'}]}
42
+ conversation.sendReaction = sinon.stub().returns(Promise.resolve())
43
+ conversation.createReactionHmac = sinon.stub().returns(Promise.resolve('hmac'))
44
+
45
+ return conversation.addReaction({}, 'example-display-name', {}, recipientId)
46
+ .then(() => {
47
+ assert.deepEqual(conversation.sendReaction.args[0][1].recipients, expected);
48
+ });
49
+ });
50
+ });
51
+
52
+ describe('deleteReaction()', () => {
53
+ it('should add recipients to the payload if provided', () => {
54
+ const {conversation} = webex.internal;
55
+ const recipientId = 'example-recipient-id';
56
+ const expected = {items: [{id: recipientId, objectType: 'person'}]}
57
+ conversation.sendReaction = sinon.stub().returns(Promise.resolve())
58
+
59
+ return conversation.deleteReaction({}, 'example-reaction-id', recipientId)
60
+ .then(() => {
61
+ assert.deepEqual(conversation.sendReaction.args[0][1].recipients, expected);
62
+ });
63
+ });
64
+ });
65
+
66
+ describe('prepare()', () => {
67
+ it('should ammend activity recipients to the returned object', () => {
68
+ const {conversation} = webex.internal;
69
+ const activity = { recipients: 'example-recipients' };
70
+
71
+ return conversation.prepare(activity)
72
+ .then((results) => {
73
+ assert.deepEqual(results.recipients, activity.recipients);
74
+ });
75
+ });
76
+ });
77
+
78
+ describe('addReaction()', () => {
79
+ it('should add recipients to the payload if provided', () => {
80
+ const {conversation} = webex.internal;
81
+ const recipientId = 'example-recipient-id';
82
+ const expected = {items: [{id: recipientId, objectType: 'person'}]}
83
+ conversation.sendReaction = sinon.stub().returns(Promise.resolve())
84
+ conversation.createReactionHmac = sinon.stub().returns(Promise.resolve('hmac'))
85
+
86
+ return conversation.addReaction({}, 'example-display-name', {}, recipientId)
87
+ .then(() => {
88
+ assert.deepEqual(conversation.sendReaction.args[0][1].recipients, expected);
89
+ });
90
+ });
91
+ });
92
+
93
+ describe('deleteReaction()', () => {
94
+ it('should add recipients to the payload if provided', () => {
95
+ const {conversation} = webex.internal;
96
+ const recipientId = 'example-recipient-id';
97
+ const expected = {items: [{id: recipientId, objectType: 'person'}]}
98
+ conversation.sendReaction = sinon.stub().returns(Promise.resolve())
99
+
100
+ return conversation.deleteReaction({}, 'example-reaction-id', recipientId)
101
+ .then(() => {
102
+ assert.deepEqual(conversation.sendReaction.args[0][1].recipients, expected);
103
+ });
104
+ });
105
+ });
106
+
107
+ describe('prepare()', () => {
108
+ it('should ammend activity recipients to the returned object', () => {
109
+ const {conversation} = webex.internal;
110
+ const activity = { recipients: 'example-recipients' };
111
+
112
+ return conversation.prepare(activity)
113
+ .then((results) => {
114
+ assert.deepEqual(results.recipients, activity.recipients);
115
+ });
116
+ });
117
+ });
118
+
37
119
  describe('processInmeetingchatEvent()', () => {
38
120
  beforeEach(() => {
39
121
  webex.transform = sinon.stub().callsFake((obj) => Promise.resolve(obj));
@@ -36,6 +36,29 @@ describe('plugin-conversation', () => {
36
36
  });
37
37
  });
38
38
 
39
+ it('does not transform when object type is "policies" for a "meetingContainer" activity', async () => {
40
+ const transform = transforms.find((t) => t.name === 'encryptActivity');
41
+ const transformStub = sinon.stub().resolves();
42
+
43
+ const ctx = {
44
+ transform: transformStub,
45
+ };
46
+ const key = null;
47
+ const activity = {
48
+ object: {
49
+ objectType: 'policies',
50
+ },
51
+ objectType: 'activity',
52
+ target: {
53
+ objectType: 'meetingContainer',
54
+ },
55
+ verb: 'update',
56
+ };
57
+
58
+ const results = await transform.fn(ctx, key, activity);
59
+ assert.equal(results, undefined);
60
+ });
61
+
39
62
  it('does transfom when created is not True', async () => {
40
63
  const transform = transforms.find((t) => t.name === 'encryptActivity');
41
64
  const transformStub = sinon.stub().resolves();