From 76a65daa0ca646009362428ba1853d6f42cc5862 Mon Sep 17 00:00:00 2001 From: Sam Ghitelman Date: Tue, 21 May 2024 17:08:52 -0400 Subject: [PATCH] Add tests --- test/spec/modules/concertBidAdapter_spec.js | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/spec/modules/concertBidAdapter_spec.js b/test/spec/modules/concertBidAdapter_spec.js index 0a76ed3e62d..fd64444936e 100644 --- a/test/spec/modules/concertBidAdapter_spec.js +++ b/test/spec/modules/concertBidAdapter_spec.js @@ -237,6 +237,31 @@ describe('ConcertAdapter', function () { const payload = JSON.parse(request.data); expect(payload.meta.tdid).to.equal(tdid); }); + + it('should return null if schain object is not present', function () { + const request = spec.buildRequests(bidRequests, bidRequest); + const payload = JSON.parse(request.data); + expect(payload.meta.schain).to.be.null; + }); + + it('should pass along schain object if present', function () { + const schain = { + ver: '1.0', + complete: 1, + nodes: [ + { + asi: 'directseller.com', + sid: '00001', + rid: 'BidRequest1', + hp: 1, + }, + ], + }; + const bidRequestsWithSchain = [{ ...bidRequests[0], schain }] + const request = spec.buildRequests(bidRequestsWithSchain, bidRequest); + const payload = JSON.parse(request.data); + expect(payload.meta.schain).to.deep.equal(schain); + }); }); describe('spec.interpretResponse', function() {