From 24cf886d860d3bbeb32bbf89532004f9903e7354 Mon Sep 17 00:00:00 2001 From: Harry King-Riches <109534328+harrykingriches@users.noreply.github.com> Date: Wed, 20 Nov 2024 15:49:40 +0000 Subject: [PATCH] FIX: Update adUnit attachment to use adUnitCode selector in rubiconBidAdapter (#12462) --- modules/rubiconBidAdapter.js | 2 +- test/spec/modules/rubiconBidAdapter_spec.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/rubiconBidAdapter.js b/modules/rubiconBidAdapter.js index c9a81e152b6..7bcc7bbd69b 100644 --- a/modules/rubiconBidAdapter.js +++ b/modules/rubiconBidAdapter.js @@ -846,7 +846,7 @@ function renderBid(bid) { height: bid.height, vastUrl: bid.vastUrl, placement: { - attachTo: adUnitElement, + attachTo: `#${bid.adUnitCode}`, align: config.align, position: config.position }, diff --git a/test/spec/modules/rubiconBidAdapter_spec.js b/test/spec/modules/rubiconBidAdapter_spec.js index 6cfdb664d27..aff6c6df171 100644 --- a/test/spec/modules/rubiconBidAdapter_spec.js +++ b/test/spec/modules/rubiconBidAdapter_spec.js @@ -4197,6 +4197,7 @@ describe('the rubicon adapter', function () { const bid = bids[0]; bid.adUnitCode = 'outstream_video1_placement'; const adUnit = document.createElement('div'); + const adUnitSelector = `#${bid.adUnitCode}` adUnit.id = bid.adUnitCode; document.body.appendChild(adUnit); @@ -4210,7 +4211,7 @@ describe('the rubicon adapter', function () { label: undefined, placement: { align: 'left', - attachTo: adUnit, + attachTo: adUnitSelector, position: 'append', }, vastUrl: 'https://test.com/vast.xml', @@ -4266,6 +4267,7 @@ describe('the rubicon adapter', function () { const bid = bids[0]; bid.adUnitCode = 'outstream_video1_placement'; const adUnit = document.createElement('div'); + const adUnitSelector = `#${bid.adUnitCode}` adUnit.id = bid.adUnitCode; document.body.appendChild(adUnit); @@ -4279,7 +4281,7 @@ describe('the rubicon adapter', function () { label: undefined, placement: { align: 'left', - attachTo: adUnit, + attachTo: adUnitSelector, position: 'append', }, vastUrl: 'https://test.com/vast.xml',