-
Notifications
You must be signed in to change notification settings - Fork 9
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
[MOB-9258] fixed nested IsSet matching #427
[MOB-9258] fixed nested IsSet matching #427
Conversation
…lso a IsSet criteria on the nested json
return Object.keys(valueFromObj).map((key) => | ||
this.getValueFromNestedObject(valueFromObj, key) | ||
); | ||
if (typeof valueFromObj === 'object' && valueFromObj !== null) { |
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.
Can we add additional test coverage for this method?
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.
While reviewing the scenario for writing the test case, I realised that this scenario will never occur because our portal doesn't accept values as objects when creating criteria. Therefore, I have removed that method, and everything is working fine for all the criteria.
} else { | ||
return valueFromObj; | ||
} | ||
} | ||
|
||
private getFieldValue(data: any, field: string): any { | ||
const fields = field.split('.'); | ||
return fields.reduce((acc, field) => acc?.[field], data); | ||
return fields.reduce((value, currentField) => { |
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 here as above
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.
We have already written test case for this. You can verify that in Line no: 672 of file 'src/anonymousUserTracking/complexCriteria.test.ts' -- it('should return criteriaId 100 (complex criteria 3)'
JIRA Ticket(s) if any
Description
[Web SDK] nested object isSet does not match
Test Steps
Video attached to the ticket, See a JIRA ticket for the video