Update tests for musor.tv

This commit is contained in:
Kristof Bach
2025-10-12 14:44:12 +02:00
parent 4885268567
commit ee0d4c367e
2 changed files with 1127 additions and 1340 deletions

File diff suppressed because one or more lines are too long

View File

@@ -8,20 +8,20 @@ const customParseFormat = require('dayjs/plugin/customParseFormat')
dayjs.extend(customParseFormat) dayjs.extend(customParseFormat)
dayjs.extend(utc) dayjs.extend(utc)
const date = dayjs.utc('2022-11-19', 'YYYY-MM-DD').startOf('d') const date = dayjs.utc('2025-10-11', 'YYYY-MM-DD').startOf('d')
const channel = { const channel = {
site_id: 'HATOS_CSATORNA', site_id: 'MAGYAR_MOZI_TV',
xmltv_id: 'Hatoscsatorna.hu' xmltv_id: 'MagyarMoziTV.hu',
} }
it('can generate valid url', () => { it('can generate valid url', () => {
expect(url({ channel, date })).toBe('https://musor.tv/napi/tvmusor/HATOS_CSATORNA/2022.11.19') expect(url({ channel, date })).toBe('https://musor.tv/napi/tvmusor/MAGYAR_MOZI_TV/2025.10.11')
}) })
it('can generate valid url for today', () => { it('can generate valid url for today', () => {
const today = dayjs.utc().startOf('d') const today = dayjs.utc().startOf('d')
expect(url({ channel, date: today })).toBe('https://musor.tv/mai/tvmusor/HATOS_CSATORNA') expect(url({ channel, date: today })).toBe('https://musor.tv/mai/tvmusor/MAGYAR_MOZI_TV')
}) })
it('can parse response', () => { it('can parse response', () => {
@@ -33,18 +33,17 @@ it('can parse response', () => {
}) })
expect(results[0]).toMatchObject({ expect(results[0]).toMatchObject({
start: '2022-11-19T23:00:00.000Z', start: '2025-10-10T23:05:00.000Z',
stop: '2022-11-19T23:30:00.000Z', stop: '2025-10-11T00:50:00.000Z',
title: 'Egészségtér', title: 'A 25. év - Három rohadék rockcsempész (Tankcsapda road movie)',
description: description: 'Lévai Balázs több mint egy éven át forgatott a Tankcsapdával.'
'Egészségtér címmel új természetgyógyászattal foglalkozó magazinműsor indult hetente fél órás időtartamban a hatoscsatornán. A műsor derűs, objektív hangvételével és szakmailag magas színvonalú ismeretterjesztő jellegével az e'
}) })
expect(results[1]).toMatchObject({ expect(results[1]).toMatchObject({
start: '2022-11-19T23:30:00.000Z', start: '2025-10-11T00:50:00.000Z',
stop: '2022-11-20T00:00:00.000Z', stop: '2025-10-11T01:45:00.000Z',
title: 'Tradíció Klipek', title: 'Megbélyegzetten - 1968',
description: 'Tradíció Klipek Birinyi József néprajzi, vallási, népzenei, népszokás filmjeiből.' description: 'Néhány tinédzser diák, egy csalinak szánt újságcikk nyomán levelet írt Ausztriába 1968-ban.'
}) })
}) })