2019-02-10 15:26:50 +03:00
|
|
|
describe('videodownloader:youtube', async () => {
|
|
|
|
test('requests YouTube', async () => {
|
|
|
|
global.nlu.brain.execute = jest.fn()
|
2019-03-05 03:38:18 +03:00
|
|
|
await global.nlu.process('Download new videos from YouTube')
|
2019-02-10 15:26:50 +03:00
|
|
|
|
|
|
|
const [obj] = global.nlu.brain.execute.mock.calls
|
|
|
|
await global.brain.execute(obj[0])
|
|
|
|
|
2019-03-28 03:45:37 +03:00
|
|
|
expect(global.brain.interOutput.codes).toIncludeSameMembers(['reaching_playlist'])
|
|
|
|
expect([
|
2019-02-10 15:26:50 +03:00
|
|
|
'settings_error',
|
|
|
|
'request_error',
|
|
|
|
'nothing_to_download',
|
|
|
|
'success'
|
2019-03-28 03:45:37 +03:00
|
|
|
]).toIncludeAnyMembers(global.brain.finalOutput.codes)
|
2019-02-10 15:26:50 +03:00
|
|
|
})
|
|
|
|
})
|