@webex/internal-plugin-board 3.0.0-beta.13 → 3.0.0-beta.131
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/README.md +1 -3
- package/dist/board.js +44 -110
- package/dist/board.js.map +1 -1
- package/dist/config.js +0 -8
- package/dist/config.js.map +1 -1
- package/dist/index.js +7 -28
- package/dist/index.js.map +1 -1
- package/dist/realtime-channel-collection.js +2 -8
- package/dist/realtime-channel-collection.js.map +1 -1
- package/dist/realtime-channel.js +1 -5
- package/dist/realtime-channel.js.map +1 -1
- package/dist/realtime.js +38 -82
- package/dist/realtime.js.map +1 -1
- package/package.json +14 -14
- package/src/board.js +273 -207
- package/src/config.js +2 -2
- package/src/index.js +19 -21
- package/src/realtime-channel-collection.js +2 -2
- package/src/realtime-channel.js +8 -9
- package/src/realtime.js +109 -93
- package/test/integration/spec/board.js +347 -221
- package/test/integration/spec/realtime.js +84 -57
- package/test/integration/spec/sharing-mercury.js +154 -73
- package/test/unit/spec/board.js +327 -216
- package/test/unit/spec/encryption.js +152 -120
- package/test/unit/spec/realtime.js +131 -89
|
@@ -12,72 +12,97 @@ import fh from '@webex/test-helper-file';
|
|
|
12
12
|
import {map} from 'lodash';
|
|
13
13
|
import uuid from 'uuid';
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
// SPARK-413317
|
|
16
|
+
describe.skip('plugin-board', () => {
|
|
16
17
|
describe('realtime', () => {
|
|
17
18
|
let board, conversation, fixture, participants;
|
|
18
19
|
let mccoy, spock;
|
|
19
20
|
let mccoyRealtimeChannel, spockRealtimeChannel;
|
|
20
21
|
|
|
21
|
-
before('create users', () =>
|
|
22
|
-
.then(async (users) => {
|
|
22
|
+
before('create users', () =>
|
|
23
|
+
testUsers.create({count: 2}).then(async (users) => {
|
|
23
24
|
participants = [spock, mccoy] = users;
|
|
24
25
|
|
|
25
26
|
// Pause for 5 seconds for CI
|
|
26
27
|
await new Promise((done) => setTimeout(done, 5000));
|
|
27
28
|
|
|
28
|
-
return Promise.all(
|
|
29
|
-
participant
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return participant.webex.internal.device.register();
|
|
45
|
-
}));
|
|
46
|
-
}));
|
|
47
|
-
|
|
48
|
-
before('create conversation', () => spock.webex.internal.conversation.create({
|
|
49
|
-
displayName: 'Test Board Conversation',
|
|
50
|
-
participants
|
|
51
|
-
})
|
|
52
|
-
.then((c) => {
|
|
53
|
-
conversation = c;
|
|
54
|
-
|
|
55
|
-
return conversation;
|
|
56
|
-
}));
|
|
29
|
+
return Promise.all(
|
|
30
|
+
map(participants, (participant) => {
|
|
31
|
+
participant.webex = new WebexCore({
|
|
32
|
+
credentials: {
|
|
33
|
+
authorization: participant.token,
|
|
34
|
+
},
|
|
35
|
+
// NOTE: temp fix so that realtime tests pass
|
|
36
|
+
// Test user catalogue does not include the URL from utc
|
|
37
|
+
config: {
|
|
38
|
+
services: {
|
|
39
|
+
override: {
|
|
40
|
+
'mercury-test': 'wss://mercury-connection-llm.intb1.ciscospark.com/',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
});
|
|
57
45
|
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
return participant.webex.internal.device.register();
|
|
47
|
+
})
|
|
48
|
+
);
|
|
49
|
+
})
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
before('create conversation', () =>
|
|
53
|
+
spock.webex.internal.conversation
|
|
54
|
+
.create({
|
|
55
|
+
displayName: 'Test Board Conversation',
|
|
56
|
+
participants,
|
|
57
|
+
})
|
|
58
|
+
.then((c) => {
|
|
59
|
+
conversation = c;
|
|
60
|
+
|
|
61
|
+
return conversation;
|
|
62
|
+
})
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
before('create channel (board)', () =>
|
|
66
|
+
spock.webex.internal.board.createChannel(conversation).then((channel) => {
|
|
60
67
|
board = channel;
|
|
61
68
|
|
|
62
69
|
return channel;
|
|
63
|
-
})
|
|
70
|
+
})
|
|
71
|
+
);
|
|
64
72
|
|
|
65
|
-
before('connect to realtime channel', () =>
|
|
73
|
+
before('connect to realtime channel', () =>
|
|
74
|
+
Promise.all(
|
|
75
|
+
map(participants, (participant) =>
|
|
76
|
+
participant.webex.internal.board.realtime.connectByOpenNewMercuryConnection(board)
|
|
77
|
+
)
|
|
78
|
+
)
|
|
79
|
+
);
|
|
66
80
|
|
|
67
81
|
before('get realtime channels', () => {
|
|
68
|
-
spockRealtimeChannel = spock.webex.internal.board.realtime.realtimeChannels.get(
|
|
69
|
-
|
|
82
|
+
spockRealtimeChannel = spock.webex.internal.board.realtime.realtimeChannels.get(
|
|
83
|
+
board.channelId
|
|
84
|
+
);
|
|
85
|
+
mccoyRealtimeChannel = mccoy.webex.internal.board.realtime.realtimeChannels.get(
|
|
86
|
+
board.channelId
|
|
87
|
+
);
|
|
70
88
|
});
|
|
71
89
|
|
|
72
|
-
before('load fixture image', () =>
|
|
73
|
-
.then((fetchedFixture) => {
|
|
90
|
+
before('load fixture image', () =>
|
|
91
|
+
fh.fetch('sample-image-small-one.png').then((fetchedFixture) => {
|
|
74
92
|
fixture = fetchedFixture;
|
|
75
93
|
|
|
76
94
|
return fetchedFixture;
|
|
77
|
-
})
|
|
95
|
+
})
|
|
96
|
+
);
|
|
78
97
|
|
|
79
98
|
// disconnect realtime
|
|
80
|
-
after('disconnect realtime channel', () =>
|
|
99
|
+
after('disconnect realtime channel', () =>
|
|
100
|
+
Promise.all(
|
|
101
|
+
map(participants, (participant) =>
|
|
102
|
+
participant.webex.internal.board.realtime.disconnectMercuryConnection(board)
|
|
103
|
+
)
|
|
104
|
+
)
|
|
105
|
+
);
|
|
81
106
|
|
|
82
107
|
describe('#config', () => {
|
|
83
108
|
it('shares board values', () => {
|
|
@@ -104,11 +129,11 @@ describe('plugin-board', () => {
|
|
|
104
129
|
const data = {
|
|
105
130
|
envelope: {
|
|
106
131
|
channelId: board,
|
|
107
|
-
roomId: conversation.id
|
|
132
|
+
roomId: conversation.id,
|
|
108
133
|
},
|
|
109
134
|
payload: {
|
|
110
|
-
msg: uniqueRealtimeData
|
|
111
|
-
}
|
|
135
|
+
msg: uniqueRealtimeData,
|
|
136
|
+
},
|
|
112
137
|
};
|
|
113
138
|
|
|
114
139
|
// confirm that both are connected.
|
|
@@ -117,19 +142,20 @@ describe('plugin-board', () => {
|
|
|
117
142
|
|
|
118
143
|
spock.webex.internal.board.realtime.publish(board, data);
|
|
119
144
|
|
|
120
|
-
return maxWaitForEvent(5000, 'event:board.activity', mccoyRealtimeChannel)
|
|
121
|
-
|
|
145
|
+
return maxWaitForEvent(5000, 'event:board.activity', mccoyRealtimeChannel).then(
|
|
146
|
+
(event) => {
|
|
122
147
|
assert.equal(event.data.contentType, 'STRING');
|
|
123
148
|
assert.equal(event.data.payload.msg, uniqueRealtimeData);
|
|
124
|
-
}
|
|
149
|
+
}
|
|
150
|
+
);
|
|
125
151
|
});
|
|
126
152
|
});
|
|
127
153
|
|
|
128
154
|
describe('file payload', () => {
|
|
129
155
|
let testScr;
|
|
130
156
|
|
|
131
|
-
it('uploads file to webex files which includes loc', () =>
|
|
132
|
-
.then((scr) => {
|
|
157
|
+
it('uploads file to webex files which includes loc', () =>
|
|
158
|
+
mccoy.webex.internal.board._uploadImage(board, fixture).then((scr) => {
|
|
133
159
|
assert.property(scr, 'loc');
|
|
134
160
|
testScr = scr;
|
|
135
161
|
}));
|
|
@@ -138,15 +164,15 @@ describe('plugin-board', () => {
|
|
|
138
164
|
const data = {
|
|
139
165
|
envelope: {
|
|
140
166
|
channelId: board,
|
|
141
|
-
roomId: conversation.id
|
|
167
|
+
roomId: conversation.id,
|
|
142
168
|
},
|
|
143
169
|
payload: {
|
|
144
170
|
displayName: 'image.png',
|
|
145
171
|
type: 'FILE',
|
|
146
172
|
file: {
|
|
147
|
-
scr: testScr
|
|
148
|
-
}
|
|
149
|
-
}
|
|
173
|
+
scr: testScr,
|
|
174
|
+
},
|
|
175
|
+
},
|
|
150
176
|
};
|
|
151
177
|
|
|
152
178
|
// confirm that both are listening.
|
|
@@ -155,12 +181,13 @@ describe('plugin-board', () => {
|
|
|
155
181
|
|
|
156
182
|
spock.webex.internal.board.realtime.publish(board, data);
|
|
157
183
|
|
|
158
|
-
return maxWaitForEvent(5000, 'event:board.activity', mccoyRealtimeChannel)
|
|
159
|
-
|
|
184
|
+
return maxWaitForEvent(5000, 'event:board.activity', mccoyRealtimeChannel).then(
|
|
185
|
+
(event) => {
|
|
160
186
|
assert.equal(event.data.contentType, 'FILE');
|
|
161
187
|
assert.equal(event.data.payload.file.scr.loc, testScr.loc);
|
|
162
188
|
assert.equal(event.data.payload.displayName, 'image.png');
|
|
163
|
-
}
|
|
189
|
+
}
|
|
190
|
+
);
|
|
164
191
|
});
|
|
165
192
|
});
|
|
166
193
|
});
|
|
@@ -17,93 +17,133 @@ describe.skip('plugin-board', () => {
|
|
|
17
17
|
let mccoy, spock;
|
|
18
18
|
let uniqueRealtimeData;
|
|
19
19
|
|
|
20
|
-
before('create users', () =>
|
|
21
|
-
.then((users) => {
|
|
20
|
+
before('create users', () =>
|
|
21
|
+
testUsers.create({count: 2}).then((users) => {
|
|
22
22
|
participants = [spock, mccoy] = users;
|
|
23
23
|
|
|
24
|
-
return Promise.all(
|
|
25
|
-
participant
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return participant.webex.internal.device.register()
|
|
32
|
-
.then(() => participant.webex.internal.feature.setFeature('developer', 'web-shared-mercury', true));
|
|
33
|
-
}));
|
|
34
|
-
}));
|
|
35
|
-
|
|
36
|
-
before('create conversation', () => spock.webex.internal.conversation.create({
|
|
37
|
-
displayName: 'Test Board Mercury',
|
|
38
|
-
participants
|
|
39
|
-
})
|
|
40
|
-
.then((c) => {
|
|
41
|
-
conversation = c;
|
|
42
|
-
|
|
43
|
-
return conversation;
|
|
44
|
-
}));
|
|
24
|
+
return Promise.all(
|
|
25
|
+
participants.map((participant) => {
|
|
26
|
+
participant.webex = new WebexCore({
|
|
27
|
+
credentials: {
|
|
28
|
+
authorization: participant.token,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
45
31
|
|
|
46
|
-
|
|
47
|
-
|
|
32
|
+
return participant.webex.internal.device
|
|
33
|
+
.register()
|
|
34
|
+
.then(() =>
|
|
35
|
+
participant.webex.internal.feature.setFeature(
|
|
36
|
+
'developer',
|
|
37
|
+
'web-shared-mercury',
|
|
38
|
+
true
|
|
39
|
+
)
|
|
40
|
+
);
|
|
41
|
+
})
|
|
42
|
+
);
|
|
43
|
+
})
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
before('create conversation', () =>
|
|
47
|
+
spock.webex.internal.conversation
|
|
48
|
+
.create({
|
|
49
|
+
displayName: 'Test Board Mercury',
|
|
50
|
+
participants,
|
|
51
|
+
})
|
|
52
|
+
.then((c) => {
|
|
53
|
+
conversation = c;
|
|
54
|
+
|
|
55
|
+
return conversation;
|
|
56
|
+
})
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
before('create channel (board)', () =>
|
|
60
|
+
spock.webex.internal.board.createChannel(conversation).then((channel) => {
|
|
48
61
|
board = channel;
|
|
49
62
|
|
|
50
63
|
return channel;
|
|
51
|
-
})
|
|
64
|
+
})
|
|
65
|
+
);
|
|
52
66
|
|
|
53
|
-
before('create second channel (board)', () =>
|
|
54
|
-
.then((channel) => {
|
|
67
|
+
before('create second channel (board)', () =>
|
|
68
|
+
mccoy.webex.internal.board.createChannel(conversation).then((channel) => {
|
|
55
69
|
secondBoard = channel;
|
|
56
70
|
|
|
57
71
|
return channel;
|
|
58
|
-
})
|
|
72
|
+
})
|
|
73
|
+
);
|
|
59
74
|
|
|
60
|
-
beforeEach('connect to mercury channel', () =>
|
|
75
|
+
beforeEach('connect to mercury channel', () =>
|
|
76
|
+
Promise.all(participants.map((participant) => participant.webex.internal.mercury.connect()))
|
|
77
|
+
);
|
|
61
78
|
|
|
62
|
-
afterEach('disconnect mercury', () =>
|
|
79
|
+
afterEach('disconnect mercury', () =>
|
|
80
|
+
Promise.all(
|
|
81
|
+
participants.map((participant) => participant.webex.internal.mercury.disconnect())
|
|
82
|
+
)
|
|
83
|
+
);
|
|
63
84
|
|
|
64
85
|
describe('#publish()', () => {
|
|
65
86
|
describe('string payload', () => {
|
|
66
87
|
let spockRealtimeChannel;
|
|
67
88
|
let mccoyRealtimeChannel;
|
|
68
89
|
|
|
69
|
-
before('open two connections', () =>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
90
|
+
before('open two connections', () =>
|
|
91
|
+
Promise.all([
|
|
92
|
+
spock.webex.internal.board.realtime.connectToSharedMercury(board),
|
|
93
|
+
mccoy.webex.internal.board.realtime.connectByOpenNewMercuryConnection(board),
|
|
94
|
+
])
|
|
95
|
+
);
|
|
73
96
|
|
|
74
97
|
before('get realtime channels', () => {
|
|
75
|
-
spockRealtimeChannel = spock.webex.internal.board.realtime.realtimeChannels.get(
|
|
76
|
-
|
|
98
|
+
spockRealtimeChannel = spock.webex.internal.board.realtime.realtimeChannels.get(
|
|
99
|
+
board.channelId
|
|
100
|
+
);
|
|
101
|
+
mccoyRealtimeChannel = mccoy.webex.internal.board.realtime.realtimeChannels.get(
|
|
102
|
+
board.channelId
|
|
103
|
+
);
|
|
77
104
|
});
|
|
78
105
|
|
|
79
|
-
after(() =>
|
|
106
|
+
after(() =>
|
|
107
|
+
Promise.all(
|
|
108
|
+
participants.map((participant) =>
|
|
109
|
+
participant.webex.internal.board.realtime.disconnectFromSharedMercury(board)
|
|
110
|
+
)
|
|
111
|
+
)
|
|
112
|
+
);
|
|
80
113
|
|
|
81
114
|
it('posts a message from shared connection to the specified board', () => {
|
|
82
115
|
uniqueRealtimeData = uuid.v4();
|
|
83
116
|
const data = {
|
|
84
117
|
envelope: {
|
|
85
118
|
channelId: board,
|
|
86
|
-
roomId: conversation.id
|
|
119
|
+
roomId: conversation.id,
|
|
87
120
|
},
|
|
88
121
|
payload: {
|
|
89
|
-
msg: uniqueRealtimeData
|
|
90
|
-
}
|
|
122
|
+
msg: uniqueRealtimeData,
|
|
123
|
+
},
|
|
91
124
|
};
|
|
92
125
|
|
|
93
126
|
// confirm that both are connected.
|
|
94
|
-
assert.isTrue(
|
|
127
|
+
assert.isTrue(
|
|
128
|
+
spockRealtimeChannel.isSharingMercury,
|
|
129
|
+
'spock is sharing mercury connection'
|
|
130
|
+
);
|
|
95
131
|
assert.isTrue(spock.webex.internal.mercury.connected, 'spock is connected');
|
|
96
|
-
assert.isFalse(
|
|
132
|
+
assert.isFalse(
|
|
133
|
+
mccoyRealtimeChannel.isSharingMercury,
|
|
134
|
+
'mccoy should not share mercury connection'
|
|
135
|
+
);
|
|
97
136
|
assert.isTrue(mccoy.webex.internal.mercury.connected, 'mccoy is connected');
|
|
98
137
|
|
|
99
138
|
spock.webex.internal.board.realtime.publish(board, data);
|
|
100
139
|
|
|
101
140
|
// mccoy listens and verifies data received
|
|
102
|
-
return maxWaitForEvent(5000, 'event:board.activity', mccoyRealtimeChannel)
|
|
103
|
-
|
|
141
|
+
return maxWaitForEvent(5000, 'event:board.activity', mccoyRealtimeChannel).then(
|
|
142
|
+
({data}) => {
|
|
104
143
|
assert.equal(data.contentType, 'STRING');
|
|
105
144
|
assert.equal(data.payload.msg, uniqueRealtimeData);
|
|
106
|
-
}
|
|
145
|
+
}
|
|
146
|
+
);
|
|
107
147
|
});
|
|
108
148
|
|
|
109
149
|
it('posts a message from separated socket connection to the specified board', () => {
|
|
@@ -111,25 +151,32 @@ describe.skip('plugin-board', () => {
|
|
|
111
151
|
const data = {
|
|
112
152
|
envelope: {
|
|
113
153
|
channelId: board,
|
|
114
|
-
roomId: conversation.id
|
|
154
|
+
roomId: conversation.id,
|
|
115
155
|
},
|
|
116
156
|
payload: {
|
|
117
|
-
msg: uniqueRealtimeData
|
|
118
|
-
}
|
|
157
|
+
msg: uniqueRealtimeData,
|
|
158
|
+
},
|
|
119
159
|
};
|
|
120
160
|
|
|
121
161
|
assert.isTrue(spock.webex.internal.mercury.connected, 'spock is connected');
|
|
122
|
-
assert.isTrue(
|
|
162
|
+
assert.isTrue(
|
|
163
|
+
spockRealtimeChannel.isSharingMercury,
|
|
164
|
+
'spock is sharing mercury connection'
|
|
165
|
+
);
|
|
123
166
|
assert.isTrue(mccoy.webex.internal.mercury.connected, 'mccoy is connected');
|
|
124
|
-
assert.isFalse(
|
|
167
|
+
assert.isFalse(
|
|
168
|
+
mccoyRealtimeChannel.isSharingMercury,
|
|
169
|
+
'mccoy does not share mercury connection'
|
|
170
|
+
);
|
|
125
171
|
|
|
126
172
|
mccoy.webex.internal.board.realtime.publish(board, data);
|
|
127
173
|
|
|
128
|
-
return maxWaitForEvent(5000, 'event:board.activity', spockRealtimeChannel)
|
|
129
|
-
|
|
174
|
+
return maxWaitForEvent(5000, 'event:board.activity', spockRealtimeChannel).then(
|
|
175
|
+
({data}) => {
|
|
130
176
|
assert.equal(data.contentType, 'STRING');
|
|
131
177
|
assert.equal(data.payload.msg, uniqueRealtimeData);
|
|
132
|
-
}
|
|
178
|
+
}
|
|
179
|
+
);
|
|
133
180
|
});
|
|
134
181
|
});
|
|
135
182
|
});
|
|
@@ -139,46 +186,77 @@ describe.skip('plugin-board', () => {
|
|
|
139
186
|
uniqueRealtimeData = uuid.v4();
|
|
140
187
|
|
|
141
188
|
return promiseSeries([
|
|
142
|
-
spock.webex.internal.board.realtime.connectToSharedMercury.bind(
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
189
|
+
spock.webex.internal.board.realtime.connectToSharedMercury.bind(
|
|
190
|
+
spock.webex.internal.board.realtime,
|
|
191
|
+
board
|
|
192
|
+
),
|
|
193
|
+
mccoy.webex.internal.board.realtime.connectToSharedMercury.bind(
|
|
194
|
+
mccoy.webex.internal.board.realtime,
|
|
195
|
+
board
|
|
196
|
+
),
|
|
197
|
+
spock.webex.internal.board.realtime.connectToSharedMercury.bind(
|
|
198
|
+
spock.webex.internal.board.realtime,
|
|
199
|
+
secondBoard
|
|
200
|
+
),
|
|
201
|
+
mccoy.webex.internal.board.realtime.connectToSharedMercury.bind(
|
|
202
|
+
mccoy.webex.internal.board.realtime,
|
|
203
|
+
secondBoard
|
|
204
|
+
),
|
|
146
205
|
]);
|
|
147
206
|
});
|
|
148
207
|
|
|
149
|
-
afterEach(() =>
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
208
|
+
afterEach(() =>
|
|
209
|
+
Promise.all(
|
|
210
|
+
participants.map((participant) =>
|
|
211
|
+
promiseSeries([
|
|
212
|
+
participant.webex.internal.board.realtime.disconnectFromSharedMercury.bind(
|
|
213
|
+
participant.webex.internal.board.realtime,
|
|
214
|
+
board
|
|
215
|
+
),
|
|
216
|
+
participant.webex.internal.board.realtime.disconnectFromSharedMercury.bind(
|
|
217
|
+
participant.webex.internal.board.realtime,
|
|
218
|
+
secondBoard
|
|
219
|
+
),
|
|
220
|
+
])
|
|
221
|
+
)
|
|
222
|
+
)
|
|
223
|
+
);
|
|
153
224
|
|
|
154
225
|
it('receives correct message for the corresponding board', (done) => {
|
|
155
226
|
const data1 = {
|
|
156
227
|
envelope: {
|
|
157
228
|
channelId: board,
|
|
158
|
-
roomId: conversation.id
|
|
229
|
+
roomId: conversation.id,
|
|
159
230
|
},
|
|
160
231
|
payload: {
|
|
161
|
-
msg: `first message for ${board.channelId} ${uniqueRealtimeData}
|
|
162
|
-
}
|
|
232
|
+
msg: `first message for ${board.channelId} ${uniqueRealtimeData}`,
|
|
233
|
+
},
|
|
163
234
|
};
|
|
164
235
|
const data2 = {
|
|
165
236
|
envelope: {
|
|
166
237
|
channelId: secondBoard,
|
|
167
|
-
roomId: conversation.id
|
|
238
|
+
roomId: conversation.id,
|
|
168
239
|
},
|
|
169
240
|
payload: {
|
|
170
|
-
msg: `second message for ${secondBoard.channelId} ${uniqueRealtimeData}
|
|
171
|
-
}
|
|
241
|
+
msg: `second message for ${secondBoard.channelId} ${uniqueRealtimeData}`,
|
|
242
|
+
},
|
|
172
243
|
};
|
|
173
244
|
|
|
174
245
|
let receivedFirstMsg = false;
|
|
175
246
|
let receivedSecondMsg = false;
|
|
176
|
-
const mccoyRealtimeChannel0 = mccoy.webex.internal.board.realtime.realtimeChannels.get(
|
|
177
|
-
|
|
247
|
+
const mccoyRealtimeChannel0 = mccoy.webex.internal.board.realtime.realtimeChannels.get(
|
|
248
|
+
board.channelId
|
|
249
|
+
);
|
|
250
|
+
const mccoyRealtimeChannel1 = mccoy.webex.internal.board.realtime.realtimeChannels.get(
|
|
251
|
+
secondBoard.channelId
|
|
252
|
+
);
|
|
178
253
|
|
|
179
254
|
mccoyRealtimeChannel0.once('event:board.activity', ({data}) => {
|
|
180
255
|
assert.equal(data.contentType, 'STRING');
|
|
181
|
-
assert.equal(
|
|
256
|
+
assert.equal(
|
|
257
|
+
data.payload.msg,
|
|
258
|
+
`first message for ${board.channelId} ${uniqueRealtimeData}`
|
|
259
|
+
);
|
|
182
260
|
receivedFirstMsg = true;
|
|
183
261
|
if (receivedFirstMsg && receivedSecondMsg) {
|
|
184
262
|
done();
|
|
@@ -187,7 +265,10 @@ describe.skip('plugin-board', () => {
|
|
|
187
265
|
|
|
188
266
|
mccoyRealtimeChannel1.once('event:board.activity', ({data}) => {
|
|
189
267
|
assert.equal(data.contentType, 'STRING');
|
|
190
|
-
assert.equal(
|
|
268
|
+
assert.equal(
|
|
269
|
+
data.payload.msg,
|
|
270
|
+
`second message for ${secondBoard.channelId} ${uniqueRealtimeData}`
|
|
271
|
+
);
|
|
191
272
|
receivedSecondMsg = true;
|
|
192
273
|
if (receivedFirstMsg && receivedSecondMsg) {
|
|
193
274
|
done();
|
|
@@ -196,7 +277,7 @@ describe.skip('plugin-board', () => {
|
|
|
196
277
|
|
|
197
278
|
Promise.all([
|
|
198
279
|
spock.webex.internal.board.realtime.publish(board, data1),
|
|
199
|
-
spock.webex.internal.board.realtime.publish(secondBoard, data2)
|
|
280
|
+
spock.webex.internal.board.realtime.publish(secondBoard, data2),
|
|
200
281
|
]);
|
|
201
282
|
});
|
|
202
283
|
});
|