Skip to content

Commit 5abefa2

Browse files
author
=
committed
fix unit tests to reflect added entities field
1 parent ef54b41 commit 5abefa2

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

packages/core/src/utils/getActivityLivestreamingMetadata.spec.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ describe.each([['with "streamId"' as const], ['without "streamId"' as const]])('
101101
{
102102
...(variant === 'with "streamId"' ? { streamId: 'a-00001' } : {}),
103103
streamSequence: 1,
104-
streamType: 'streaming'
104+
streamType: 'streaming',
105+
type: 'streaminfo'
105106
}
106107
],
107108
channelData: {},
@@ -134,7 +135,8 @@ describe.each([['with "streamId"' as const], ['without "streamId"' as const]])('
134135
{
135136
...(variant === 'with "streamId"' ? { streamId: 'a-00001' } : {}),
136137
streamSequence: 1,
137-
streamType: 'informative'
138+
streamType: 'informative',
139+
type: 'streaminfo'
138140
}
139141
],
140142
channelData: {},
@@ -166,7 +168,8 @@ describe.each([['with "streamId"' as const], ['without "streamId"' as const]])('
166168
entities: [
167169
{
168170
...(variant === 'with "streamId"' ? { streamId: 'a-00001' } : {}),
169-
streamType: 'final'
171+
streamType: 'final',
172+
type: 'streaminfo'
170173
}
171174
],
172175
channelData: {},
@@ -204,7 +207,7 @@ test('activity with "streamType" of "streaming" without critical fields should r
204207
test('activity with "streamType" of "streaming" without critical fields should return undefined (entities)', () =>
205208
expect(
206209
getActivityLivestreamingMetadata({
207-
entities: [{ streamType: 'streaming' }],
210+
entities: [{ streamType: 'streaming', type: 'streaminfo' }],
208211
channelData: {},
209212
type: 'typing'
210213
} as any)
@@ -235,7 +238,7 @@ describe.each([
235238
['decimal', 1.234, false]
236239
])('activity with %s "streamSequence" should return undefined (entities)', (_, streamSequence, isValid) => {
237240
const activity = {
238-
entities: [{ streamSequence, streamType: 'streaming' }],
241+
entities: [{ streamSequence, streamType: 'streaming', type: 'streaminfo' }],
239242
channelData: {},
240243
id: 'a-00001',
241244
text: '',
@@ -275,7 +278,7 @@ describe('"typing" activity with "streamType" of "final" (entities)', () => {
275278
test('should return undefined if "text" field is defined', () =>
276279
expect(
277280
getActivityLivestreamingMetadata({
278-
entities: [{ streamId: 'a-00001', streamType: 'final' }],
281+
entities: [{ streamId: 'a-00001', streamType: 'final', type: 'streaminfo' }],
279282
channelData: {},
280283
id: 'a-00002',
281284
text: 'Final "typing" activity, must not have "text".',
@@ -286,7 +289,7 @@ describe('"typing" activity with "streamType" of "final" (entities)', () => {
286289
test('should return truthy if "text" field is not defined', () =>
287290
expect(
288291
getActivityLivestreamingMetadata({
289-
entities: [{ streamId: 'a-00001', streamType: 'final' }],
292+
entities: [{ streamId: 'a-00001', streamType: 'final', type: 'streaminfo' }],
290293
channelData: {},
291294
id: 'a-00002',
292295
// Final activity can be "typing" if it does not have "text".
@@ -307,7 +310,7 @@ test('activity with "streamType" of "streaming" without "content" should return
307310
test('activity with "streamType" of "streaming" without "content" should return type of "contentless" (entities)', () =>
308311
expect(
309312
getActivityLivestreamingMetadata({
310-
entities: [{ streamSequence: 1, streamType: 'streaming' }],
313+
entities: [{ streamSequence: 1, streamType: 'streaming', type: 'streaminfo' }],
311314
channelData: {},
312315
id: 'a-00001',
313316
type: 'typing'

0 commit comments

Comments
 (0)