fix: Initialize modal state from initialData and improve test stability #11328
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request improves the reliability and maintainability of the global variable modal and its related end-to-end tests. The main changes include making the modal correctly initialize its state from
initialData, refactoring the user settings tests to be more robust when selecting fields, and enhancing test selectors for better stability.Frontend logic improvements:
GlobalVariableModalcomponent now properly initializes its state (key,value,type, andfields) from theinitialDataprop when it is provided, ensuring the modal displays correct information when editing existing variables.Test robustness and maintainability:
FALLBACK_FIELDSlist and a new helper functiontrySelectAvailableFieldinuserSettings.spec.tsto attempt selecting any available field from a prioritized list, making the test less brittle to changes in available fields. [1] [2].ag-cell:has-text(...)instead of relying on.last(), making element targeting more precise and robust. [1] [2]Test tagging:
@componentstag to the "should see general profile gradient" test for improved test categorization.Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.