|
2 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 | 3 | * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ |
4 | 4 |
|
| 5 | +// Tests the search bar retains previous query on re-opening. |
| 6 | + |
5 | 7 | "use strict"; |
6 | 8 |
|
7 | | -// Tests the search bar retains previous query on re-opening. |
8 | | -add_task(async function testSearchRetainsPreviousQuery() { |
| 9 | +add_task(async function () { |
9 | 10 | const dbg = await initDebugger("doc-scripts.html", "simple1.js"); |
10 | 11 | const { |
11 | 12 | selectors: { getActiveSearch }, |
@@ -35,54 +36,3 @@ add_task(async function testSearchRetainsPreviousQuery() { |
35 | 36 | // Test for the retained query |
36 | 37 | is(findElement(dbg, "fileSearchInput").value, "con"); |
37 | 38 | }); |
38 | | - |
39 | | -// Tests that the search results are updated when switching between sources |
40 | | -add_task(async function testSearchUpdatesResultsOnSourceChanges() { |
41 | | - const dbg = await initDebugger("doc-scripts.html", "simple1.js", "long.js"); |
42 | | - const { |
43 | | - selectors: { getActiveSearch }, |
44 | | - } = dbg; |
45 | | - |
46 | | - await selectSource(dbg, "simple1.js"); |
47 | | - |
48 | | - // Open search bar |
49 | | - pressKey(dbg, "fileSearch"); |
50 | | - await waitFor(() => getActiveSearch() === "file"); |
51 | | - is(getActiveSearch(), "file"); |
52 | | - |
53 | | - // Type a search query |
54 | | - const searchQuery = "this"; |
55 | | - type(dbg, searchQuery); |
56 | | - await waitForSearchState(dbg); |
57 | | - |
58 | | - await waitUntil( |
59 | | - () => findElement(dbg, "fileSearchSummary").innerText !== "No results found" |
60 | | - ); |
61 | | - |
62 | | - is( |
63 | | - findElement(dbg, "fileSearchSummary").innerText, |
64 | | - "1 of 3 results", |
65 | | - `There are 3 results found for search query "${searchQuery}" in simple1.js` |
66 | | - ); |
67 | | - is( |
68 | | - findElement(dbg, "fileSearchInput").value, |
69 | | - searchQuery, |
70 | | - `The search input value matches the search query "${searchQuery}"` |
71 | | - ); |
72 | | - |
73 | | - info("Switch to long.js"); |
74 | | - await selectSource(dbg, "long.js"); |
75 | | - |
76 | | - await waitUntil( |
77 | | - () => findElement(dbg, "fileSearchSummary").innerText == "1 of 23 results" |
78 | | - ); |
79 | | - ok( |
80 | | - true, |
81 | | - `There are 23 results found for search query "${searchQuery}" in long.js` |
82 | | - ); |
83 | | - is( |
84 | | - findElement(dbg, "fileSearchInput").value, |
85 | | - searchQuery, |
86 | | - `The search input value still matches the search query "${searchQuery}"` |
87 | | - ); |
88 | | -}); |
0 commit comments