1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-26 10:14:57 +03:00
leon/packages/videodownloader/test/youtube.spec.js

20 lines
547 B
JavaScript

'use strict'
describe('videodownloader:youtube', async () => {
test('requests YouTube', async () => {
global.nlu.brain.execute = jest.fn()
await global.nlu.process('Download new videos from YouTube')
const [obj] = global.nlu.brain.execute.mock.calls
await global.brain.execute(obj[0])
await expect(global.brain.interOutput.code).toBe('reaching_playlist')
await expect([
'settings_error',
'request_error',
'nothing_to_download',
'success'
]).toContain(global.brain.finalOutput.code)
})
})