mirror of
https://github.com/iptv-org/epg
synced 2026-04-29 14:06:59 -04:00
Update visionplus.id guide.
This site now can serve id and en language. Signed-off-by: Toha <tohenk@yahoo.com>
This commit is contained in:
@@ -9,27 +9,26 @@ dayjs.extend(utc)
|
||||
|
||||
jest.mock('axios')
|
||||
|
||||
const date = dayjs.utc('2023-06-30', 'YYYY-MM-DD').startOf('d')
|
||||
const date = dayjs.utc('2024-11-23', 'YYYY-MM-DD').startOf('d')
|
||||
const channel = {
|
||||
site_id: '2',
|
||||
xmltv_id: 'RCTI.id'
|
||||
site_id: '00000000000000000001',
|
||||
xmltv_id: 'RCTI.id',
|
||||
lang: 'en'
|
||||
}
|
||||
const channelId = { ...channel, lang: 'id' }
|
||||
|
||||
|
||||
it('can generate valid url', () => {
|
||||
expect(url({ channel, date })).toBe(
|
||||
'https://epg-api.visionplus.id/api/v1/epg?isLive=false&start_time_from=2023-06-30&channel_ids=2'
|
||||
'https://www.visionplus.id/managetv/tvinfo/events/schedule?language=ENG&serviceId=00000000000000000001&start=2024-11-23T00%3A00%3A00Z&end=2024-11-24T00%3A00%3A00Z&view=cd-events-grid-view'
|
||||
)
|
||||
expect(url({ channel: channelId, date })).toBe(
|
||||
'https://www.visionplus.id/managetv/tvinfo/events/schedule?language=IND&serviceId=00000000000000000001&start=2024-11-23T00%3A00%3A00Z&end=2024-11-24T00%3A00%3A00Z&view=cd-events-grid-view'
|
||||
)
|
||||
})
|
||||
|
||||
it('can generate valid request headers', () => {
|
||||
expect(request.headers).toMatchObject({
|
||||
Authorization:
|
||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE5NDY0NTE4OTcsInVpZCI6MCwicGwiOiJ3ZWIiLCJndWVzdF90b2tlbiI6ImNhNGNjMjdiNzc3MjBjODEwNzQ2YzY3MTY4NzNjMDI3NGU4NWYxMWQifQ.tt08jLZ3HiNadUeSgc9O-nhIzEi7WMYRjxMb05lEZ74'
|
||||
})
|
||||
})
|
||||
|
||||
it('can parse response', () => {
|
||||
const content = fs.readFileSync(path.resolve(__dirname, '__data__/content.json'))
|
||||
let content = fs.readFileSync(path.resolve(__dirname, '__data__/content_en.json'))
|
||||
let results = parser({ content, channel, date })
|
||||
results = results.map(p => {
|
||||
p.start = p.start.toJSON()
|
||||
@@ -37,19 +36,28 @@ it('can parse response', () => {
|
||||
return p
|
||||
})
|
||||
|
||||
expect(results.length).toBe(18)
|
||||
expect(results.length).toBe(1)
|
||||
expect(results[0]).toMatchObject({
|
||||
start: '2023-06-29T18:15:00.000Z',
|
||||
stop: '2023-06-29T19:00:00.000Z',
|
||||
title: 'Hafalan Shalat Delisa',
|
||||
description: ''
|
||||
start: '2024-11-23T00:15:00.000Z',
|
||||
stop: '2024-11-23T01:00:00.000Z',
|
||||
title: 'Kiko',
|
||||
description: "Kiko tells of a child of a goldfish who is very independent, even though he is an only child. Kiko who is always cheerful has four good friends, namely Lola the discus fish, Ting Ting the crab, Patino the catfish and Poli the betta fish. On the other hand, the antagonists, Karkus the catfish and Pupus the eel, always make Kiko's life chaotic. One day, the lake where Kiko lives is polluted due to the reckless acts of humans, causing Kiko and friends to turn into mutants."
|
||||
})
|
||||
|
||||
expect(results[17]).toMatchObject({
|
||||
start: '2023-06-30T16:15:00.000Z',
|
||||
stop: '2023-06-30T18:15:00.000Z',
|
||||
title: 'Tukang Bubur Pulang Haji',
|
||||
description: ''
|
||||
content = fs.readFileSync(path.resolve(__dirname, '__data__/content_id.json'))
|
||||
results = parser({ content, channel: channelId, date })
|
||||
results = results.map(p => {
|
||||
p.start = p.start.toJSON()
|
||||
p.stop = p.stop.toJSON()
|
||||
return p
|
||||
})
|
||||
|
||||
expect(results.length).toBe(1)
|
||||
expect(results[0]).toMatchObject({
|
||||
start: '2024-11-23T00:15:00.000Z',
|
||||
stop: '2024-11-23T01:00:00.000Z',
|
||||
title: 'Kiko',
|
||||
description: 'Kiko, seekor anak ikan mas koki yang sangat mandiri, walaupun ia anak tunggal. Kiko selalu riang dan memiliki empat sahabat baik yaitu Lola si ikan diskus, Ting Ting si kepiting, Patino si ikan patin dan Poli si ikan cupang. Di sisi lain, sosok antagonis, Karkus si ikan lele dan Pupus si belut, selalu membuat ricuh kehidupan Kiko.'
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user