// import { expect } from 'chai' // import * as fetchMock from 'fetch-mock' // import { CUSTOMER_API, CLICK_TRACKING_URL } from '../../js/utils/ResourceConstants' // import * as chrome from 'sinon-chrome' // import { bulkGetOneShotTokens, bulkGetClickTrackIds, patchClickTrackIds } from '../../js/utils/contentHelpers' // need to figure out how to import XMLHttpRequest // ReferenceError: XMLHttpRequest is not defined // xdescribe('contentHelpers', () => { // describe('it should fetch apis correctly', () => { // const testToken = 'token' // const testEmail = 'test@email.com' // const testClickId = 'testClickId' // afterEach(() => fetchMock.restore()) // it('hits the bulkGetOneShotTokens endpoint correctly', () => { // fetchMock.post( // (url, opts: any) => { // return url === `${CUSTOMER_API}/auth/oneshot/bulk` // && opts.body === `{"emailAddresses":["test@email.com"]}` // && opts.headers.Authorization === 'bearer token' // }, // { status: 200 }) // return bulkGetOneShotTokens(testToken, [testEmail]).then((response) => { // expect(response.status).to.equal(200) // }) // }) // it('hits the bulkGetClickTrackIds endpoint correctly', () => { // fetchMock.post( // (url, opts: any) => { // return url === `${CLICK_TRACKING_URL}/click` // && opts.body === `[{"url":"www.drift.com"}]` // && opts.headers.Authorization === 'bearer token' // }, // { status: 200 }) // return bulkGetClickTrackIds(testToken, [{ url: 'www.drift.com' }]).then((response: any) => { // expect(response.status).to.equal(200) // }) // }) // it('hits the patchClickTrackIds endpoint correctly', () => { // fetchMock.patch( // (url, opts: any) => { // return url === `${CLICK_TRACKING_URL}/click/data/${testClickId}` // && opts.body === `{"gmailId":"gmailId"}` // && opts.headers.Authorization === 'bearer token' // }, // { status: 200 }) // return patchClickTrackIds(testToken, testClickId, { gmailId: 'gmailId' }).then((response) => { // expect(response.status).to.equal(200) // }) // }) // }) // })