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

[FSSDK-8184] override attribute bug fix of track method #287

Merged
merged 3 commits into from
Nov 6, 2024

Conversation

junaed-optimizely
Copy link
Contributor

@junaed-optimizely junaed-optimizely commented Nov 6, 2024

Summary

While checking the second parameter of OptimizelyReactClient.track, to decide if its a userId or eventTags, overrideAttributes is set to undefined if the second argument is eventTags, which should not be the case. userId and attribute overrides are two seperate things.

Test plan

  • Test structure of track method of React client has improved
  • New test case added to cover this specific scenario

Issues

Copy link

github-actions bot commented Nov 6, 2024

Jest Coverage Report

St.
Category Percentage Covered / Total
🟢 Statements
98.95% (-0% 🔻)
846/855
🟢 Branches 91.6% 338/369
🟢 Functions 97.52% 157/161
🟢 Lines
99.09% (-0% 🔻)
764/771
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢 client.ts
99.27% (-0% 🔻)
94.33% 96.97%
99.5% (-0% 🔻)

Test suite run success

263 tests passing in 10 suites.

Report generated by 🧪jest coverage report action from 99c53b9

@junaed-optimizely junaed-optimizely marked this pull request as ready for review November 6, 2024 14:41
Copy link
Contributor

@mikechu-optimizely mikechu-optimizely left a comment

Choose a reason for hiding this comment

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

LGTM.

Do need to cover if track's overrideUserId is null or if _client is not initialized / null? Maybe overkill?

src/client.spec.ts Show resolved Hide resolved
@junaed-optimizely junaed-optimizely merged commit 33b4344 into master Nov 6, 2024
13 checks passed
@junaed-optimizely junaed-optimizely deleted the junaed/fssdk-8184-track-method-bug branch November 6, 2024 17:00
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