This commit is contained in:
1 parent
d266a8258d
commit
774200fb39
4 files changed
+38
-15
No files matched your search
@@ -26,10 +26,34 @@ test('playlist always contains three fixed channels', () => {
|
||||
assert.equal(lines[0], '#EXTM3U');
|
||||
assert.equal(
|
||||
lines[1],
|
||||
'#EXTINF:-1 tvg-id="jupiler-1" tvg-name="Jupiler 1",Jupiler 1 | Standard de Liège - SK Beveren (19:25)'
|
||||
'#EXTINF:-1 tvg-id="jupiler-1" tvg-name="Jupiler 1" tvg-chno="1",Jupiler 1'
|
||||
);
|
||||
assert.equal(lines[2], 'http://example.test:8080/stream/1');
|
||||
assert.ok(body.includes('Jupiler 2 | Geen wedstrijd'));
|
||||
assert.ok(body.includes('Jupiler 3 | Geen wedstrijd'));
|
||||
assert.ok(body.includes('#EXTINF:-1 tvg-id="jupiler-2" tvg-name="Jupiler 2" tvg-chno="2",Jupiler 2'));
|
||||
assert.ok(body.includes('#EXTINF:-1 tvg-id="jupiler-3" tvg-name="Jupiler 3" tvg-chno="3",Jupiler 3'));
|
||||
assert.ok(body.includes('http://example.test:8080/stream/3'));
|
||||
});
|
||||
|
||||
test('channel metadata stays identical when the assigned event changes', () => {
|
||||
const first = {
|
||||
getSlotCount: () => 3,
|
||||
getSlotEvent: (index) => (index === 0 ? event : null),
|
||||
};
|
||||
const second = {
|
||||
getSlotCount: () => 3,
|
||||
getSlotEvent: (index) =>
|
||||
index === 0
|
||||
? {
|
||||
key: 'b',
|
||||
title: 'Anderlecht - Genk',
|
||||
startAt: new Date('2026-11-06T21:00:00Z'),
|
||||
endAt: new Date('2026-11-06T23:30:00Z'),
|
||||
}
|
||||
: null,
|
||||
};
|
||||
const channelLines = (body) => body.split('\n').filter((line) => line.startsWith('#EXTINF'));
|
||||
assert.deepEqual(
|
||||
channelLines(buildPlaylist(fakeRequest(), first)),
|
||||
channelLines(buildPlaylist(fakeRequest(), second))
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user