Skip to content

Commit 777b486

Browse files
committed
fix tests
1 parent 3b59f77 commit 777b486

File tree

4 files changed

+34
-10
lines changed

4 files changed

+34
-10
lines changed

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
},
4646
"devDependencies": {
4747
"@livekit/components-styles": "workspace:*",
48-
"@livekit/protocol": "^1.23.0",
48+
"@livekit/protocol": "^1.36.1",
4949
"@microsoft/api-extractor": "^7.36.0",
5050
"@size-limit/file": "^11.0.2",
5151
"@size-limit/webpack": "^11.0.2",

packages/core/src/track-reference/test-utils.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
* @internal
55
*/
66

7-
import { Participant, Track, TrackPublication } from 'livekit-client';
7+
import { Participant, RemoteTrackPublication, Track, TrackPublication } from 'livekit-client';
88
import type { UpdatableItem } from '../sorting/tile-array-update';
99
import type { TrackReference, TrackReferencePlaceholder } from './track-reference.types';
1010
import { getTrackReferenceId } from './track-reference.utils';
11+
import { TrackInfo } from '@livekit/protocol';
1112

1213
// Test function:
1314
export const mockTrackReferencePlaceholder = (
@@ -21,9 +22,15 @@ export const mockTrackReferencePublished = (id: string, source: Track.Source): T
2122
const kind = [Track.Source.Camera, Track.Source.ScreenShare].includes(source)
2223
? Track.Kind.Video
2324
: Track.Kind.Audio;
25+
const trackInfo = new TrackInfo({
26+
sid: `${id}`,
27+
name: `${id}`,
28+
muted: false,
29+
});
2430
return {
2531
participant: new Participant(`${id}`, `${id}`),
26-
publication: new TrackPublication(kind, `${id}`, `${id}`),
32+
// @ts-expect-error
33+
publication: new RemoteTrackPublication(kind, trackInfo, true),
2734
source: source,
2835
};
2936
};
@@ -42,8 +49,13 @@ export const mockTrackReferenceSubscribed = (
4249
const kind = [Track.Source.Camera, Track.Source.ScreenShare].includes(source)
4350
? Track.Kind.Video
4451
: Track.Kind.Audio;
45-
46-
const publication = new TrackPublication(kind, `${id}`, `${id}`);
52+
const trackInfo = new TrackInfo({
53+
sid: `${id}`,
54+
name: `${id}`,
55+
muted: false,
56+
});
57+
// @ts-expect-error
58+
const publication = new RemoteTrackPublication(kind, trackInfo, true);
4759
// @ts-expect-error
4860
publication.track = {};
4961
return {

packages/core/src/utilis.test.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
1-
import { Participant, Track, TrackPublication } from 'livekit-client';
1+
import { Participant, RemoteTrackPublication, Track } from 'livekit-client';
22
import { describe, it, expect } from 'vitest';
33
import { isTrackReferencePinned } from './track-reference';
44
import type { PinState } from './types';
5+
import { TrackInfo } from '@livekit/protocol';
56

67
describe('Test isTrackReferencePinned', () => {
78
const participantA = new Participant('dummy-participant', 'A_id', 'track_A_name');
8-
const trackA = new TrackPublication(Track.Kind.Video, 'track_A_id', 'track_A_name');
9-
trackA.trackSid = 'track_a_sid';
9+
const trackInfoA = new TrackInfo({
10+
sid: 'track_a_sid',
11+
name: 'track_A_name',
12+
muted: false,
13+
});
14+
// @ts-expect-error
15+
const trackA = new RemoteTrackPublication(Track.Kind.Video, trackInfoA, true);
1016
const participantB = new Participant('participant_B', 'B_id', 'B_name');
11-
const trackB = new TrackPublication(Track.Kind.Video, 'track_B_id', 'track_B_name');
17+
const trackInfoB = new TrackInfo({
18+
sid: 'track_b_sid',
19+
name: 'track_B_name',
20+
muted: false,
21+
});
22+
// @ts-expect-error
23+
const trackB = new RemoteTrackPublication(Track.Kind.Video, trackInfoB, true);
1224
trackB.trackSid = 'track_b_sid';
1325
const trackReferenceA = {
1426
participant: participantA,

pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)