Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sparteo Bid Adapter: add adUnitCode #12305

Merged
merged 1 commit into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/sparteoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const converter = ortbConverter({
const imp = buildImp(bidRequest, context);

deepSetValue(imp, 'ext.sparteo.params', bidRequest.params);
imp.ext.sparteo.params.adUnitCode = bidRequest.adUnitCode;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the tests below would pass without this code change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for having a look!

What do you mean ? They don't pass if I remove this line:

  SparteoAdapter
    buildRequests
      Check method return
        ✖ should return the right formatted requests
          Chrome Headless 129.0.0.0 (Mac OS 10.15.7)
        AssertionError: expected { method: 'POST', …(2) } to deeply equal { method: 'POST', …(2) }

      + expected - actual

               }
               "ext": {
                 "sparteo": {
                   "params": {
      +              "adUnitCode": "id-1234"
                     "formats": [
                       "corner"
                     ]
                     "networkId": "1234567a-eb1b-1fae-1d23-e1fbaef234cf"
               "ext": {
                 "pbadslot": "video"
                 "sparteo": {
                   "params": {
      +              "adUnitCode": "id-5678"
                     "networkId": "1234567a-eb1b-1fae-1d23-e1fbaef234cf"
                   }
                 }
               }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @patmmccann, thank you for your feedback last week. Would you mind having a look at this answer, please?

If I'm not wrong, it should be already covered by tests.


return imp;
},
Expand Down
8 changes: 6 additions & 2 deletions test/spec/modules/sparteoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const VALID_REQUEST_BANNER = {
'sparteo': {
'params': {
'networkId': '1234567a-eb1b-1fae-1d23-e1fbaef234cf',
'adUnitCode': 'id-1234',
'formats': ['corner']
}
}
Expand Down Expand Up @@ -112,7 +113,8 @@ const VALID_REQUEST_VIDEO = {
'pbadslot': 'video',
'sparteo': {
'params': {
'networkId': '1234567a-eb1b-1fae-1d23-e1fbaef234cf'
'networkId': '1234567a-eb1b-1fae-1d23-e1fbaef234cf',
'adUnitCode': 'id-5678'
}
}
}
Expand Down Expand Up @@ -147,6 +149,7 @@ const VALID_REQUEST = {
'sparteo': {
'params': {
'networkId': '1234567a-eb1b-1fae-1d23-e1fbaef234cf',
'adUnitCode': 'id-1234',
'formats': ['corner']
}
}
Expand All @@ -170,7 +173,8 @@ const VALID_REQUEST = {
'pbadslot': 'video',
'sparteo': {
'params': {
'networkId': '1234567a-eb1b-1fae-1d23-e1fbaef234cf'
'networkId': '1234567a-eb1b-1fae-1d23-e1fbaef234cf',
'adUnitCode': 'id-5678'
}
}
}
Expand Down