You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix replaceMessage function to handle escaped variables (#716)
* Fix replaceMessage function to handle escaped variables
Modify the `replaceMessage` function in `src/utils/validateUtil.ts` to handle escaped variables and add related test cases.
* **replaceMessage function**:
- Update the `replaceMessage` function to skip conversion when `\${xxx}` is passed and convert `${xxx}` correctly.
- Check for the presence of `\${xxx}` and skip conversion in such cases.
- Ensure the function correctly converts `${xxx}` to the corresponding value from the `kv` object.
* **validate.test.tsx**:
- Add test cases to verify the correct handling of `\${xxx}` and `${xxx}`.
- Ensure the test cases cover both scenarios: skipping conversion and converting correctly.
- Add a new test case to handle escaped and unescaped variables correctly.
---
For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/react-component/field-form?shareId=XXXX-XXXX-XXXX-XXXX).
* Update validateUtil.ts
* test: fix test case
0 commit comments