From cd2a99aa128352be8b6df62ae84625ccc7b9adb8 Mon Sep 17 00:00:00 2001 From: esanuandra Date: Mon, 21 Jul 2025 14:19:08 +0300 Subject: [PATCH] Add autocomplete component fix tests fix multiple select revision checkbox Fix Snackbar, fetchRevisionBySearch and fetchRevisionbyID test Update SearchInputAndResult to theme.palette Rename AutocompleteInput and AutocompleteOption Remove SearchResultsList and SearchResultsListItem Fix input field for new remains populated after a revision is selected --- .../OverTimeResultsView.test.tsx.snap | 20 +- .../__snapshots__/ResultsTable.test.tsx.snap | 552 ++- .../__snapshots__/ResultsView.test.tsx.snap | 38 +- .../__snapshots__/Retrigger.test.tsx.snap | 4 +- .../__snapshots__/SearchInput.test.tsx.snap | 2 +- .../SubtestsResultsView.test.tsx.snap | 163 +- src/__tests__/Search/CompareOverTime.test.tsx | 33 +- src/__tests__/Search/CompareWithBase.test.tsx | 8 +- .../Search/SearchResultsList.test.tsx | 80 +- src/__tests__/Search/SearchView.test.tsx | 46 +- .../Search/SelectedRevision.test.tsx | 49 +- .../CompareOverTime.test.tsx.snap | 494 ++- .../CompareWithBase.test.tsx.snap | 1711 ++++++--- .../SearchContainer.test.tsx.snap | 336 +- .../SearchResultsList.test.tsx.snap | 3222 +++++++---------- .../__snapshots__/SearchView.test.tsx.snap | 1687 ++++++--- .../Search/fetchRecentRevisions.test.tsx | 19 +- .../Search/fetchRevisionByID.test.tsx | 47 +- .../Search/fetchRevisionsBySearch.test.tsx | 40 +- src/__tests__/Snackbar.test.tsx | 38 +- src/__tests__/__snapshots__/App.test.tsx.snap | 15 +- .../Search/RevisionAutocompleteInput.tsx | 79 + .../Search/RevisionAutocompleteOption.tsx | 138 + .../Search/SearchInputAndResults.tsx | 200 +- src/components/Search/SearchResultsList.tsx | 124 - .../Search/SearchResultsListItem.tsx | 146 - src/theme/protocolTheme.ts | 27 + 27 files changed, 5296 insertions(+), 4022 deletions(-) create mode 100644 src/components/Search/RevisionAutocompleteInput.tsx create mode 100644 src/components/Search/RevisionAutocompleteOption.tsx delete mode 100644 src/components/Search/SearchResultsList.tsx delete mode 100644 src/components/Search/SearchResultsListItem.tsx diff --git a/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap b/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap index 067598ccd..143372790 100644 --- a/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap +++ b/src/__tests__/CompareResults/__snapshots__/OverTimeResultsView.test.tsx.snap @@ -301,7 +301,7 @@ exports[`Results View The table should match snapshot and other elements should class="f6hg2jo" > + + + @@ -542,7 +583,7 @@ exports[`Results Table Should match snapshot 1`] = ` class="MuiFormControl-root search-dropdown f1o9jg5h css-1iw3t7y-MuiFormControl-root" > @@ -826,7 +909,7 @@ exports[`Results Table Should match snapshot 1`] = ` Results + + + @@ -3329,7 +3453,7 @@ exports[`Results Table for MannWhitneyResultsItem for mann-whitney-u testVersion class="MuiFormControl-root search-dropdown f1o9jg5h css-1iw3t7y-MuiFormControl-root" > @@ -3613,7 +3779,7 @@ exports[`Results Table for MannWhitneyResultsItem for mann-whitney-u testVersion Results + + + @@ -338,7 +380,7 @@ exports[`Compare Over Time renders correctly in Search View: Initial state for t
+
+ +
@@ -1348,7 +1432,7 @@ exports[`Compare Over Time should have an edit mode in Results View: After click class="fs9pw6x cancel-compare" > + + + @@ -2022,7 +2148,7 @@ exports[`Compare Over Time should remove the checked revision once X button is c
+
+ +
@@ -3036,7 +3204,7 @@ exports[`Compare Over Time should update base repo, revisions and time-range aft class="fs9pw6x cancel-compare" > + + + @@ -374,7 +416,7 @@ exports[`Compare With Base renders correctly when there are no results: Initial class="MuiFormControl-root search-dropdown f1o9jg5h css-1iw3t7y-MuiFormControl-root" > @@ -658,13 +742,13 @@ exports[`Compare With Base selects and displays new framework when clicked 1`] =
- -`; - -exports[`SearchResultsList should match snapshot 1`] = ` - -
-
- -
-
-
-
- -
-
- -
-
-

- PerfCompare -

-
- Analyze results of performance tests to detect regressions and identify opportunities for improvement. -
- -
-
-
- - Compare with a base or over time - -
-
-
-

- Compare with a base -

-

- Analyze differences between specific revisions. -

-
- -
-
-
-
-
-
@@ -1994,7 +445,7 @@ exports[`SearchResultsList should match snapshot 1`] = ` class="MuiFormControl-root search-dropdown f1o9jg5h css-1iw3t7y-MuiFormControl-root" > @@ -2132,7 +625,7 @@ exports[`SearchResultsList should match snapshot 1`] = `
+
+ +
@@ -2513,102 +1048,907 @@ exports[`SearchResultsList should match snapshot 1`] = `
+
+
    +
+
+ + + + + + + + + + diff --git a/src/__tests__/Search/__snapshots__/SearchView.test.tsx.snap b/src/__tests__/Search/__snapshots__/SearchView.test.tsx.snap index 54d02d2dc..afbf00eaa 100644 --- a/src/__tests__/Search/__snapshots__/SearchView.test.tsx.snap +++ b/src/__tests__/Search/__snapshots__/SearchView.test.tsx.snap @@ -39,15 +39,14 @@ exports[`Search View renders correctly when there are no results 1`] = ` class="PrivateSwitchBase-input MuiSwitch-input css-12xagqm-MuiSwitchBase-root" id="Dark mode" name="toggle-dark-mode" - role="switch" type="checkbox" /> + + + @@ -403,7 +444,7 @@ exports[`Search View renders correctly when there are no results 1`] = ` class="MuiFormControl-root search-dropdown f1o9jg5h css-1iw3t7y-MuiFormControl-root" > @@ -541,7 +624,7 @@ exports[`Search View renders correctly when there are no results 1`] = `
+
+ +
@@ -964,7 +1089,7 @@ exports[`Search View renders correctly when there are no results 1`] = `
+
+ +
@@ -1501,7 +1668,7 @@ exports[`With search parameters both search components are populated as expected
+
+ +
@@ -1744,7 +1953,7 @@ exports[`With search parameters both search components are populated as expected class="MuiFormControl-root search-dropdown f1o9jg5h css-1iw3t7y-MuiFormControl-root" > @@ -2022,7 +2273,7 @@ exports[`With search parameters both search components are populated as expected
+
+ +
@@ -2552,7 +2845,7 @@ exports[`With search parameters both search components are populated as expected
+
+ +
@@ -2795,7 +3130,7 @@ exports[`With search parameters both search components are populated as expected class="MuiFormControl-root search-dropdown f1o9jg5h css-1iw3t7y-MuiFormControl-root" > @@ -3073,7 +3450,7 @@ exports[`With search parameters both search components are populated as expected
+
+ +
@@ -3603,7 +4022,7 @@ exports[`With search parameters displays the default value for framework if the
+
+ +
@@ -3846,7 +4307,7 @@ exports[`With search parameters displays the default value for framework if the class="MuiFormControl-root search-dropdown f1o9jg5h css-1iw3t7y-MuiFormControl-root" > @@ -4124,7 +4627,7 @@ exports[`With search parameters displays the default value for framework if the
+
+ +
@@ -4514,7 +5059,7 @@ exports[`With search parameters displays the default values if some values are b
+
+ +
@@ -4757,7 +5344,7 @@ exports[`With search parameters displays the default values if some values are b class="MuiFormControl-root search-dropdown f1o9jg5h css-1iw3t7y-MuiFormControl-root" > @@ -4895,7 +5524,7 @@ exports[`With search parameters displays the default values if some values are b