-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathrtcpfb-line.spec.ts
More file actions
51 lines (45 loc) · 1.76 KB
/
rtcpfb-line.spec.ts
File metadata and controls
51 lines (45 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { RtcpFbLine } from './rtcpfb-line';
describe('rtcpFbLine', () => {
describe('fromSdpLine', () => {
it('should parse a numeric payload type', () => {
expect.hasAssertions();
const line = RtcpFbLine.fromSdpLine('rtcp-fb:96 goog-remb');
expect(line).toBeDefined();
expect(line?.payloadType.value).toBe(96);
expect(line?.payloadType.isWildcard()).toBe(false);
expect(line?.feedback).toBe('goog-remb');
});
it('should parse a wildcard payload type', () => {
expect.hasAssertions();
const line = RtcpFbLine.fromSdpLine('rtcp-fb:* nack');
expect(line).toBeDefined();
expect(line?.payloadType.value).toBe('*');
expect(line?.payloadType.isWildcard()).toBe(true);
expect(line?.feedback).toBe('nack');
});
it('should parse a wildcard payload type with compound feedback', () => {
expect.hasAssertions();
const line = RtcpFbLine.fromSdpLine('rtcp-fb:* nack pli');
expect(line).toBeDefined();
expect(line?.payloadType.value).toBe('*');
expect(line?.feedback).toBe('nack pli');
});
it('should return undefined for invalid line', () => {
expect.hasAssertions();
const line = RtcpFbLine.fromSdpLine('rtcp-fb:abc nack');
expect(line).toBeUndefined();
});
});
describe('toSdpLine', () => {
it('should serialize a numeric payload type', () => {
expect.hasAssertions();
const line = RtcpFbLine.fromSdpLine('rtcp-fb:96 goog-remb');
expect(line?.toSdpLine()).toBe('a=rtcp-fb:96 goog-remb');
});
it('should serialize a wildcard payload type', () => {
expect.hasAssertions();
const line = RtcpFbLine.fromSdpLine('rtcp-fb:* nack pli');
expect(line?.toSdpLine()).toBe('a=rtcp-fb:* nack pli');
});
});
});