
nock = require 'nock'
vtexIdApiFixture = require '../fixtures/vtexid-api.fixture.json'

vtexIdEndpointUrl = 'https://vtexid.vtex.com.br'
vtexIdEndpointPath = '/api/vtexid/pub/authenticated/user?authToken='
vtexIdReq = nock vtexIdEndpointUrl

vtexIdReq
  .persist()
  .get(vtexIdEndpointPath + 'authUser')
  .reply(201, vtexIdApiFixture.authorizedUser)

vtexIdReq
  .persist()
  .get(vtexIdEndpointPath + 'null')
  .reply(201, vtexIdApiFixture.badToken)

vtexIdReq
  .persist()
  .get(vtexIdEndpointPath + 'error')
  .reply(201, vtexIdApiFixture.apiError)

module.exports = vtexIdReq
