-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix:send default and update consent payloads on kit init #58
Conversation
There was a problem hiding this 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
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]); |
There was a problem hiding this comment.
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)
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] |
There was a problem hiding this comment.
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
window.dataLayer[2][0].should.equal('consent'); | ||
window.dataLayer[2][1].should.equal('update'); | ||
window.dataLayer[2][2].should.deepEqual( | ||
expectedDataLayerAfter[2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto to above
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] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tritto to above
## [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))
Summary
Testing Plan
Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)