-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow multiple values for string operators in the dashboard (#42013)
* Expand the single or multi-selectable string filter choices * Mark operators as `multi` * Wrap an existing test in a separate `describe` block * Test multiple values settings * Expand repro to include multiple dashboard filter values * Ease the load by limiting the card results * Switch to the more flexible data structure for the dashboard filters * Expand the assertions * Fix typo Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com> --------- Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
- Loading branch information
1 parent
50e64ab
commit 1a44a83
Showing
5 changed files
with
174 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 53 additions & 12 deletions
65
e2e/test/scenarios/dashboard-filters/shared/dashboard-filters-text-category.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,67 @@ | ||
export const DASHBOARD_TEXT_FILTERS = { | ||
Is: { | ||
export const DASHBOARD_TEXT_FILTERS = [ | ||
{ | ||
operator: "Is", | ||
single: true, | ||
value: "Organic", | ||
representativeResult: "39.58", | ||
}, | ||
"Is not": { | ||
{ | ||
operator: "Is not", | ||
single: true, | ||
value: "Organic", | ||
representativeResult: "37.65", | ||
}, | ||
Contains: { | ||
value: "oo", | ||
// It is important to keep multiple values as a single string in the value field. | ||
{ | ||
operator: "Contains", | ||
value: "oo,aa", | ||
representativeResult: "148.23", | ||
negativeAssertion: "37.65", | ||
}, | ||
"Does not contain": { | ||
value: "oo", | ||
{ | ||
operator: "Contains", | ||
single: true, | ||
value: "oo,aa", | ||
representativeResult: "No results!", | ||
negativeAssertion: "148.23", | ||
}, | ||
{ | ||
operator: "Does not contain", | ||
value: "oo,tt", | ||
representativeResult: "39.58", | ||
negativeAssertion: "37.65", | ||
}, | ||
{ | ||
operator: "Does not contain", | ||
single: true, | ||
value: "oo,tt", | ||
representativeResult: "37.65", | ||
negativeASsertion: "39.58", | ||
}, | ||
"Starts with": { | ||
value: "A", | ||
{ | ||
operator: "Starts with", | ||
value: "A,b", | ||
representativeResult: "85.72", | ||
negativeASsertion: "70.15", | ||
}, | ||
"Ends with": { | ||
value: "e", | ||
{ | ||
operator: "Starts with", | ||
single: true, | ||
value: "A,b", | ||
representativeResult: "No results!", | ||
negativeASsertion: "85.72", | ||
}, | ||
{ | ||
operator: "Ends with", | ||
value: "e,s", | ||
representativeResult: "47.68", | ||
negativeASsertion: "127.88", | ||
}, | ||
{ | ||
operator: "Ends with", | ||
single: true, | ||
value: "e,s", | ||
representativeResult: "No results!", | ||
negativeASsertion: "47.68", | ||
}, | ||
}; | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters