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

When survey.data contains a number in a string format and expression … #9693

Merged
merged 3 commits into from
Apr 8, 2025

Conversation

andrewtelnov
Copy link
Member

…returns the same value as a number then survey response is not changed fix #9690

…returns the same value as a number then survey response is not changed fix #9690
@andrewtelnov andrewtelnov requested a review from Copilot April 4, 2025 11:53
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (3)

packages/survey-core/tests/question_expressiontests.ts:335

  • The error message in the assertion is misleading as it refers to the value as a string while it is expected to be a number. Consider updating the message to reflect that the value is a number.
assert.strictEqual(survey.getValue("q1"), 2, "survey.getValue('q1') is string", "

packages/survey-core/src/base.ts:1156

  • Review whether setting doNotConvertNumbers to true here is intentional, as it might prevent the desired conversion of string numbers to number types, potentially conflicting with Bug#9690.
return Helpers.checkIfValuesEqual(x, y, { ignoreOrder: false, caseSensitive: !caseInSensitive, trimStrings: trimString, doNotConvertNumbers: true });

packages/survey-core/tests/surveytests.ts:19174

  • [nitpick] Using an 'any' cast for 'menuType' may obscure underlying type issues. Consider using a more specific type or updating the options interface so that it naturally accepts a string.
options.menuType = <any>menuType;

@tsv2013 tsv2013 merged commit ed6f9f1 into master Apr 8, 2025
5 checks passed
@tsv2013 tsv2013 deleted the bug/9690-equal-string-number branch April 8, 2025 08:25
andrewtelnov added a commit that referenced this pull request Apr 8, 2025
#9693)

* When survey.data contains a number in a string format and expression returns the same value as a number then survey response is not changed fix #9690

* FIx functional test for custom widget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants