{"size": 989, "ext": "js", "max_stars_repo_path": "tests/ringover.ivrScenarioByIDAndScenarioID.test.js", "max_stars_repo_name": "montpcdev/ringover-js", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "tests/ringover.ivrScenarioByIDAndScenarioID.test.js", "max_issues_repo_name": "montpcdev/ringover-js", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "tests/ringover.ivrScenarioByIDAndScenarioID.test.js", "max_forks_repo_name": "montpcdev/ringover-js", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.9032258065, "max_line_length": 129, "alphanum_fraction": 0.6299292214}
require('dotenv').config()
const { expect } = require('chai')
const Ringover = require('../index')

describe('ivrScenarioByIDAndScenarioID', function() {
  this.timeout(0)
  const { TEST_TOKEN, TEST_IVR_ID, TEST_SCENARIO_ID } = process.env
  const clientInvalid = new Ringover('invalidtoken')
  const client = new Ringover(TEST_TOKEN)

  context('invalid token', () => {
    it('throws error', (done) => {
      clientInvalid.ivrScenarioByIDAndScenarioID(TEST_IVR_ID, TEST_SCENARIO_ID)
        .catch(err => {
          expect(err.body).to.equal('')
          done()
        })
        .catch(err => done(err))
    })
  })
  
  context('valid token', () => {
    it('returns essential information for a scenario by indicating in the route its identifier and that of its ivr.', (done) => {
      client.ivrScenarioByIDAndScenarioID(TEST_IVR_ID, TEST_SCENARIO_ID)
        .catch(err => {
          expect(err.statusCode).to.equal(401)
          done()
        })
    }).timeout(5000)
  })
})