/* eslint-disable import/no-extraneous-dependencies */
require('dotenv').config();
const test = require('ava').test;
const pickpocket = require('../pickpocket');

const p = pickpocket({
  consumerKey: process.env.CONSUMER_KEY
});

test('output of getAuthorizationURL with valid request token',
  async t => p.obtainRequestToken().then((token) => {
    const url = p.getAuthorizationURL({ requestToken: token });
    t.truthy(url.startsWith('http'),
      'valid call to getAuthorizationURL returns a url');
  })
);

@@ -508,8 +508,276 @@
   %7D)%0A);%0A
+%0Atest('output of obtainAccessToken with unauthorized request token',%0A  async t =%3E t.throws(%0A    p.obtainAccessToken(%7B requestToken: 'unauthorized_token' %7D),%0A    Error,%0A    'obtainAccessToken should throw a SyntaxError when called with an invalid request token'%0A  )%0A);%0A

Test for invalid request token call