test: Add Test Coverage for selectPlacements call#14
test: Add Test Coverage for selectPlacements call#14alexs-mparticle merged 7 commits intodevelopmentfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds test coverage for the selectPlacements call in the Rokt Forwarder.
- New tests verify that selectPlacements is called with the correct options.
- Tests confirm that user attribute filtering is applied as expected when passed through configuration and options.
Comments suppressed due to low confidence (1)
test/src/tests.js:120
- The async function for attachKit does not explicitly return a promise. To ensure consistent asynchronous behavior, consider adding 'return Promise.resolve();' within the function body.
window.mParticle.Rokt.attachKit = async () => {
test/src/tests.js
Outdated
| await waitForCondition( | ||
| () => window.mParticle.Rokt.attachKitCalled === true | ||
| ); |
There was a problem hiding this comment.
is this needed? there's no assertion below this
test/src/tests.js
Outdated
|
|
||
| it('should process user attributes filters that are passed in via the config and selectPlacements options', async () => { | ||
| window.mParticle.forwarder.filters = { | ||
| userAttributesFilters: [], |
There was a problem hiding this comment.
the test says it will process the user attribute filters that are passed on the config, but there are no filters here, so the attributes end up being the same as what is passed in.
There was a problem hiding this comment.
Technically the filters are used by filterUserAttributes via the Core SDK, and in this case we're mocking that function. The true purpose of this test is to verify that selectPlacements is correctly using the results of filterUserAttributes. Hope this change helps.
Co-authored-by: Robert Ing <ring@mparticle.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds test coverage for the selectPlacements call in the Rokt Forwarder tests. The changes include:
- Removal of an unused asynchronous waitForCondition helper function.
- Addition of three new tests to verify the proper behavior of selectPlacements, including handling of filtering logic.
Comments suppressed due to low confidence (1)
test/src/tests.js:186
- Consider correcting the spelling of 'durring' to 'during'.
// Also, any initial attributes from the init call that have updated durring runtime should be returned by the filterUserAttribute method.
…ion-name * development: test: Add Test Coverage for selectPlacements call (#14)
Summary
Testing Plan