mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update i.mjh.nz.test.js
This commit is contained in:
parent
20be5bc168
commit
8cc92c8b0b
1 changed files with 13 additions and 15 deletions
|
@ -25,22 +25,20 @@ it('can generate valid url', () => {
|
|||
|
||||
it('can parse response', () => {
|
||||
const content = `<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE tv SYSTEM "xmltv.dtd"><tv generator-info-name="www.matthuisman.nz"> <channel id="51c75f7bb6f26ba1cd00002f"> <display-name>Little Stars Universe</display-name> <icon src="https://images.pluto.tv/channels/51c75f7bb6f26ba1cd00002f/colorLogoPNG.png"/> </channel> <programme channel="51c75f7bb6f26ba1cd00002f" start="20220503104922 +0000" stop="20220503112122 +0000"> <title>Barney and Friends</title> <desc>Baby Bop forgets to say "please" and "thank you". Riff shares his dream of becoming an inventor.</desc> <category>Children & Family</category> </programme><programme channel="51c75f7bb6f26ba1cd00002f" start="20220504104922 +0000" stop="20220504112122 +0000"> <title>Barney and Friends</title> <desc>Baby Bop forgets to say "please" and "thank you". Riff shares his dream of becoming an inventor.</desc> <category>Children & Family</category> </programme></tv>`
|
||||
const result = parser({ content, channel, date }).map(p => {
|
||||
p.start = p.start.toJSON()
|
||||
p.stop = p.stop.toJSON()
|
||||
return p
|
||||
})
|
||||
const results = parser({ content, channel, date })
|
||||
|
||||
expect(result).toMatchObject([
|
||||
{
|
||||
start: '2022-05-03T10:49:22.000Z',
|
||||
stop: '2022-05-03T11:21:22.000Z',
|
||||
title: 'Barney and Friends',
|
||||
description:
|
||||
'Baby Bop forgets to say "please" and "thank you". Riff shares his dream of becoming an inventor.',
|
||||
category: ['Children', 'Family']
|
||||
}
|
||||
])
|
||||
expect(results[0]).toMatchObject({
|
||||
start: '2022-05-03T10:49:22.000Z',
|
||||
stop: '2022-05-03T11:21:22.000Z',
|
||||
title: [{ value: 'Barney and Friends' }],
|
||||
desc: [
|
||||
{
|
||||
value:
|
||||
'Baby Bop forgets to say "please" and "thank you". Riff shares his dream of becoming an inventor.'
|
||||
}
|
||||
],
|
||||
category: [{ value: 'Children & Family' }]
|
||||
})
|
||||
})
|
||||
|
||||
it('can handle empty guide', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue