-
Notifications
You must be signed in to change notification settings - Fork 83
[FSSDK-9152] Fix "client_initialized" event not firing #820
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
Conversation
assert.equal(readyData.success, true); | ||
assert.isUndefined(readyData.reason); | ||
|
||
setTimeout(() => sinon.assert.callCount(apiManager.sendEvents, 1), 100); |
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.
This really needs to check sendEvents(events) has a "client_initialized" in the array.
This ancient version of sinon is really hard to work with.
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 believe we have a separate unit test for "registerVuid" which validates "client_initialized" event. If so, this may be enough to validate we have one event generated here.
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.
LGTM
assert.equal(readyData.success, true); | ||
assert.isUndefined(readyData.reason); | ||
|
||
setTimeout(() => sinon.assert.callCount(apiManager.sendEvents, 1), 100); |
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 believe we have a separate unit test for "registerVuid" which validates "client_initialized" event. If so, this may be enough to validate we have one event generated here.
This reverts commit 45611b2.
@opti-jnguyen I found the test that was failing (doing its job dutifully despite me ignoring it). I'm good to go especially with @jaeopt 's approval. |
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.
LGTM overall. Agree with your note on the test, you may be able to grab the args from the spy and do an assert equal.
Maybe something along the lines of:
const sendEventArgs1 = fakeEventManager.sendEvent.args;
assert.deepEqual(
sendEventArgs1[0].toString(),
new OdpEvent('fullstack', 'client_initialized', new Map([['fs_user_id', 'fsUserA']]), new Map()).toString()
);
That being said, if that doesn't work I'm down to merge and address later.
Summary
Test plan
Issues
FSSDK-9152