Skip to content

test(test): assert if correct condition is recreated based on conditi…#16902

Open
hanastasov wants to merge 4 commits intomasterfrom
keep-conditionName-insync
Open

test(test): assert if correct condition is recreated based on conditi…#16902
hanastasov wants to merge 4 commits intomasterfrom
keep-conditionName-insync

Conversation

@hanastasov
Copy link
Contributor

@hanastasov hanastasov commented Feb 13, 2026

conditionName is used to recreate expression.condition when restoring grid state from IgxGridState directive. Without this fix, restoring grid state would change condition from whatever it was to the default condition "contains"

Solution:

  1. When restoring, give preference to condition.name over conditionName
  2. Update conditionName = condition.name

Closes #16841

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

Copy link
Contributor

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.

Pull request overview

This PR fixes a bug where the extracted filter column state was incorrectly being set to "contains" instead of the actual selected condition when users changed filter conditions or restored grid state.

Changes:

  • Prioritized condition.name over conditionName when recreating filter expressions to ensure the correct source of truth is used
  • Made conditionName always sync with condition.name after recreation, removing the conditional check
  • Added test coverage for the scenario where conditionName and condition.name are out of sync

Reviewed changes

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

File Description
projects/igniteui-angular/core/src/data-operations/expressions-tree-util.ts Fixed priority order in recreateOperatorFromDataType and recreateExpression to use condition.name before conditionName; ensured conditionName is always synced with condition.name; exported recreateExpression function for testing
projects/igniteui-angular/core/src/data-operations/expressions-tree-util.spec.ts Added test case to verify that expressions with mismatched conditionName and condition.name are correctly recreated with the proper conditionName

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 91.572% (-0.001%) from 91.573%
when pulling cfd0ebe on keep-conditionName-insync
into b3fb7ad on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Grid State - Extracted filter column state is always set to "contains"

3 participants