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

fix:send default and update consent payloads on kit init #58

Conversation

mmustafa-tse
Copy link
Contributor

@mmustafa-tse mmustafa-tse commented Sep 30, 2024

Summary

  • Same summary as this PR we had for the GTM kit

Testing Plan

  • [Y] Was this tested locally? If not, explain why.
  • Tested E2E locally with overrides as well as unit tested

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

Copy link
Collaborator

@rmi22186 rmi22186 left a comment

Choose a reason for hiding this comment

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

looks great! minor comment for cleaning up tests, but that's it

Comment on lines 1268 to +1270
window.dataLayer[0][0].should.equal('consent');
window.dataLayer[0][1].should.equal('default');
window.dataLayer[0][2].should.deepEqual(expectedDataLayer[2]);
window.dataLayer[0][2].should.deepEqual(expectedDataLayer1[2]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I had similar feedback for alex here - you can probably refactor these 2 checks for the [0] and [1] index to be something like:

window.dataLayer[0].should.deepEqual(expectedDataLayer1)
window.dataLayer[1].should.deepEqual(expectedDataLayer2)

Comment on lines +1504 to +1513
window.dataLayer.length.should.eql(2);
window.dataLayer[0][0].should.equal('consent');
window.dataLayer[0][1].should.equal('default');
window.dataLayer[0][2].should.deepEqual(
expectedDataLayerBefore[2]
expectedDataLayerBefore1[2]
);
window.dataLayer[1][0].should.equal('consent');
window.dataLayer[1][1].should.equal('update');
window.dataLayer[1][2].should.deepEqual(
expectedDataLayerBefore2[2]
Copy link
Collaborator

Choose a reason for hiding this comment

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

same comment about doing deepEqual to the full object

Comment on lines +1570 to 1573
window.dataLayer[2][0].should.equal('consent');
window.dataLayer[2][1].should.equal('update');
window.dataLayer[2][2].should.deepEqual(
expectedDataLayerAfter[2]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ditto to above

Comment on lines +1639 to 1643
window.dataLayer.length.should.eql(4);
window.dataLayer[3][0].should.equal('consent');
window.dataLayer[3][1].should.equal('update');
window.dataLayer[3][2].should.deepEqual(
expectedDataLayerFinal[2]
Copy link
Collaborator

Choose a reason for hiding this comment

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

tritto to above

@rmi22186 rmi22186 changed the base branch from master to development October 1, 2024 21:13
@rmi22186
Copy link
Collaborator

rmi22186 commented Oct 1, 2024

discussed with mo that the depe equal doesn't work bc of one being an arguments, and another being an array. there is no shallow equals in mocha/chai, but we can probably update this in the future when we do a migration to TS/jest.
image

@rmi22186 rmi22186 merged commit 97e9a2e into mparticle-integrations:development Oct 1, 2024
2 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 2, 2024
## [2.3.2](v2.3.1...v2.3.2) (2024-10-02)

### Bug Fixes

* send default and update consent payloads on kit init ([#58](#58)) ([200b918](200b918))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants