it('should request proper version of jpx ad manager', () => { createCookie('jpxhbjs', 'v2.0.0', 1); const adapter = new Adapter(); const _request = adLoader.loadScript; const parts = CONST.LIB.split('/'); parts.splice(parts.length - 1, 0, 'v2.0.0'); adapter.callBids({}); assert.equal(_request.args[1][0], window.location.protocol + parts.join('/')); expect(_request.args[1][1]).to.exist.and.to.be.a('function'); createCookie('jpxhbjs', '', 0); });
it('should request script to sync cookies and download jpx ad manager lib', () => { const adapter = new Adapter(); const _request = adLoader.loadScript; const _instance = factory.JAM.instance; adapter.callBids({}); assert(_request.calledTwice); assert.lengthOf(_request.args[0], 1); assert.lengthOf(_request.args[1], 2); assert.equal(_request.args[0][0], window.location.protocol + CONST.COOKIE); assert.equal(_request.args[1][0], window.location.protocol + CONST.LIB); expect(_request.args[1][1]).to.exist.and.to.be.a('function'); assert(_instance.calledOnce); });