Skip to content

Commit 584ed28

Browse files
committed
move fulltextsearch feature behind useFulltextSearch flag
1 parent 9d96c14 commit 584ed28

File tree

12 files changed

+126
-110
lines changed

12 files changed

+126
-110
lines changed

src/__tests__/CompareResults/__snapshots__/ResultsTable.test.tsx.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,10 @@ exports[`Results Table Should match snapshot 1`] = `
233233
</div>
234234
<input
235235
aria-invalid="false"
236-
aria-label="Search by revision ID, author, bug number and comments"
236+
aria-label="Search by revision ID or author email"
237237
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall MuiInputBase-inputAdornedStart css-jrmsot-MuiInputBase-input-MuiOutlinedInput-input"
238238
id="search-base-input"
239-
placeholder="Search by revision ID, author, bug number and comments"
239+
placeholder="Search by revision ID or author email"
240240
type="text"
241241
value=""
242242
/>
@@ -523,10 +523,10 @@ exports[`Results Table Should match snapshot 1`] = `
523523
</div>
524524
<input
525525
aria-invalid="false"
526-
aria-label="Search by revision ID, author, bug number and comments"
526+
aria-label="Search by revision ID or author email"
527527
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall MuiInputBase-inputAdornedStart css-jrmsot-MuiInputBase-input-MuiOutlinedInput-input"
528528
id="search-new-input"
529-
placeholder="Search by revision ID, author, bug number and comments"
529+
placeholder="Search by revision ID or author email"
530530
type="text"
531531
value=""
532532
/>

src/__tests__/Search/SearchView.test.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ function setupTestData() {
2222
const { testData } = getTestData();
2323
(global.fetch as FetchMockSandbox)
2424
.get(
25-
'begin:https://treeherder.mozilla.org/api/project/try/push/?search=',
25+
'begin:https://treeherder.mozilla.org/api/project/try/push/?author_contains=',
2626
(url) => {
27-
const search = new URL(url).searchParams.get('search');
28-
return { results: testData.filter((item) => item.author === search) };
27+
const author = new URL(url).searchParams.get('author_contains');
28+
return { results: testData.filter((item) => item.author === author) };
2929
},
3030
)
3131
.get(
@@ -134,7 +134,7 @@ describe('Search Container', () => {
134134
});
135135

136136
const baseInput = screen.getAllByPlaceholderText(
137-
'Search by revision ID, author, bug number and comments',
137+
'Search by revision ID or author email',
138138
)[0];
139139
const repoDropdown = screen.getByRole('button', { name: 'Base' });
140140

@@ -161,14 +161,14 @@ describe('Base and OverTime Search', () => {
161161
// Search input appears
162162
expect(
163163
screen.getAllByPlaceholderText(
164-
/Search by revision ID, author, bug number and comments/i,
164+
/Search by revision ID or author email/i,
165165
)[0],
166166
).toBeInTheDocument();
167167

168168
await expandOverTimeComponent();
169169
expect(
170170
screen.getAllByPlaceholderText(
171-
/Search by revision ID, author, bug number and comments/i,
171+
/Search by revision ID or author email/i,
172172
)[1],
173173
).toBeInTheDocument();
174174

@@ -301,11 +301,11 @@ describe('Base and OverTime Search', () => {
301301
// - once for [email protected]
302302
// The call to coconut@python.co was debounced.
303303
expect(global.fetch).not.toHaveBeenCalledWith(
304-
'https://treeherder.mozilla.org/api/project/try/push/?search=johncleese%40python.co',
304+
'https://treeherder.mozilla.org/api/project/try/push/?author_contains=johncleese%40python.co',
305305
undefined,
306306
);
307307
expect(global.fetch).toHaveBeenCalledWith(
308-
'https://treeherder.mozilla.org/api/project/try/push/?search=johncleese%40python.com',
308+
'https://treeherder.mozilla.org/api/project/try/push/?author_contains=johncleese%40python.com',
309309
undefined,
310310
);
311311
expect(global.fetch).toHaveBeenCalledTimes(4);
@@ -321,7 +321,7 @@ describe('Base and OverTime Search', () => {
321321
act(() => void jest.runAllTimers());
322322

323323
expect(global.fetch).toHaveBeenCalledWith(
324-
'https://treeherder.mozilla.org/api/project/try/push/?search=terrygilliam%40python.com',
324+
'https://treeherder.mozilla.org/api/project/try/push/?author_contains=terrygilliam%40python.com',
325325
undefined,
326326
);
327327

src/__tests__/Search/SelectedRevision.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe('SelectedRevision', () => {
7373
expect(baseDropdown).toHaveTextContent('try');
7474

7575
const firstSearchInput = screen.getAllByPlaceholderText(
76-
'Search by revision ID, author, bug number and comments',
76+
'Search by revision ID or author email',
7777
)[0];
7878
await user.click(firstSearchInput);
7979
await user.click(

src/__tests__/Search/__snapshots__/CompareOverTime.test.tsx.snap

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,10 @@ exports[`Compare Over Time renders correctly in Search View: Initial state for t
264264
</div>
265265
<input
266266
aria-invalid="false"
267-
aria-label="Search by revision ID, author, bug number and comments"
267+
aria-label="Search by revision ID or author email"
268268
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputAdornedStart css-1rgu65m-MuiInputBase-input-MuiOutlinedInput-input"
269269
id="search-new-input"
270-
placeholder="Search by revision ID, author, bug number and comments"
270+
placeholder="Search by revision ID or author email"
271271
type="text"
272272
value=""
273273
/>
@@ -1174,10 +1174,10 @@ exports[`Compare Over Time should have an edit mode in Results View: After click
11741174
</div>
11751175
<input
11761176
aria-invalid="false"
1177-
aria-label="Search by revision ID, author, bug number and comments"
1177+
aria-label="Search by revision ID or author email"
11781178
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall MuiInputBase-inputAdornedStart css-jrmsot-MuiInputBase-input-MuiOutlinedInput-input"
11791179
id="search-new-input"
1180-
placeholder="Search by revision ID, author, bug number and comments"
1180+
placeholder="Search by revision ID or author email"
11811181
type="text"
11821182
value=""
11831183
/>
@@ -1970,10 +1970,10 @@ exports[`Compare Over Time should remove the checked revision once X button is c
19701970
</div>
19711971
<input
19721972
aria-invalid="false"
1973-
aria-label="Search by revision ID, author, bug number and comments"
1973+
aria-label="Search by revision ID or author email"
19741974
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputAdornedStart css-1rgu65m-MuiInputBase-input-MuiOutlinedInput-input"
19751975
id="search-new-input"
1976-
placeholder="Search by revision ID, author, bug number and comments"
1976+
placeholder="Search by revision ID or author email"
19771977
type="text"
19781978
value=""
19791979
/>
@@ -2856,10 +2856,10 @@ exports[`Compare Over Time should update base repo, revisions and time-range aft
28562856
</div>
28572857
<input
28582858
aria-invalid="false"
2859-
aria-label="Search by revision ID, author, bug number and comments"
2859+
aria-label="Search by revision ID or author email"
28602860
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputSizeSmall MuiInputBase-inputAdornedStart css-jrmsot-MuiInputBase-input-MuiOutlinedInput-input"
28612861
id="search-new-input"
2862-
placeholder="Search by revision ID, author, bug number and comments"
2862+
placeholder="Search by revision ID or author email"
28632863
type="text"
28642864
value=""
28652865
/>

0 commit comments

Comments
 (0)