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

Create integration test for joinAdInterestGroup #21

Closed
brodrigu opened this issue Apr 7, 2021 · 1 comment · Fixed by #30 or #32
Closed

Create integration test for joinAdInterestGroup #21

brodrigu opened this issue Apr 7, 2021 · 1 comment · Fixed by #30 or #32
Assignees
Labels
feat New feature or request

Comments

@brodrigu
Copy link
Member

brodrigu commented Apr 7, 2021

Setup test infrastructure and implement the following tests for joinAdInterestGroup:

send expected params

joinAdInterestGroup({
    "owner": "dsp.example",
    "name": "foo>",
    "bidding_logic_url": "https://dsp.example/bidding_logic_url",
    "daily_update_url": "https://dsp.example/daily_update_url",
    "trusted_bidding_signals_url": "https://dsp.example/trusted_bidding_signals_url",
    "trusted_bidding_signals_keys": "foo",
    "user_bidding_signals": { "key": "value" },
    "ads": [ {" id": "adid", "url": "https://dsp.example/ad_url" } ]
}, 30 * msInDay);

and inspect indexedDB to validate it is added as expected

{
    "_created": "<Date.now()>",
    "_updated": "<unix_timestamp_in_ms_from_daily_update_url_call>",
    "_expires": "<this._created + (expiry * 86400000)>",
    "owner": "<options.owner>",
    "name": "<options.name>",
    "bidding_logic_url": "<options.bidding_logic_url>",
    "daily_update_url": "<options.daily_update_url>",
    "trusted_bidding_signals_url": "<options.tbs_url>",
    "trusted_bidding_signals_keys": "<options.tbs_keys>",
    "user_bidding_signals": "<options.user_bidding_signals>",
    "ads": "<options.ads>"
  }
@brodrigu brodrigu added the feat New feature or request label Apr 7, 2021
@brodrigu brodrigu self-assigned this Apr 7, 2021
@iamnewton iamnewton changed the title Write happy path test for joinAdInterestGroup Create happy path test for joinAdInterestGroup Apr 8, 2021
@iamnewton
Copy link
Contributor

You might also want to check for these conditions:

  1. If the same owner and name is passed in, then "merge" with the existing data, update the internal updated field to the current time and expires field will be 30 days past the current time
  2. If owner or name is passed in and doesn't match an existing group, then create an entirely new record with the options passed in, adding in the internal created field and updated field to the current date

This was linked to pull requests Apr 14, 2021
@iamnewton iamnewton changed the title Create happy path test for joinAdInterestGroup Create integration test for joinAdInterestGroup Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
2 participants