Bug 1447667 - Use a different element in preferences search test. r?jaws draft
authorZibi Braniecki <zbraniecki@mozilla.com>
Wed, 21 Mar 2018 11:12:31 -0700
changeset 770690 a5c1533d477a791406633ace771652df88cccd39
parent 770611 7b55d395bb63165c20a9230f82b3b14da09bcd2d
push id103476
push userbmo:gandalf@aviary.pl
push dateWed, 21 Mar 2018 18:12:45 +0000
reviewersjaws
bugs1447667
milestone61.0a1
Bug 1447667 - Use a different element in preferences search test. r?jaws MozReview-Commit-ID: 94HVZ9zLhH5
browser/components/preferences/in-content/tests/browser_search_within_preferences_2.js
--- a/browser/components/preferences/in-content/tests/browser_search_within_preferences_2.js
+++ b/browser/components/preferences/in-content/tests/browser_search_within_preferences_2.js
@@ -65,64 +65,64 @@ add_task(async function() {
 
   BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
 
 
 /**
  * Test that we search using `search-l10n-ids`.
  *
- * The test uses element `browserContainersSettings` and
+ * The test uses element `showUpdateHistory` and
  * l10n id `language-and-appearance-header` and expects the element
  * to be matched on the first word from the l10n id value ("Language" in en-US).
  */
 add_task(async function() {
   let l10nId = "language-and-appearance-header";
 
   await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
 
   // First, lets make sure that the element is not matched without
   // `search-l10n-ids`.
   {
     let searchInput = gBrowser.contentDocument.getElementById("searchInput");
-    let bcsElem = gBrowser.contentDocument.getElementById("browserContainersSettings");
+    let suhElem = gBrowser.contentDocument.getElementById("showUpdateHistory");
 
     is(searchInput, gBrowser.contentDocument.activeElement.closest("#searchInput"),
       "Search input should be focused when visiting preferences");
 
-    ok(!bcsElem.getAttribute("search-l10n-ids").includes(l10nId),
-      "browserContainersSettings element should not contain the l10n id here.");
+    ok(!suhElem.getAttribute("search-l10n-ids").includes(l10nId),
+      "showUpdateHistory element should not contain the l10n id here.");
 
     let query = "Language";
     let searchCompletedPromise = BrowserTestUtils.waitForEvent(
         gBrowser.contentWindow, "PreferencesSearchCompleted", evt => evt.detail == query);
     EventUtils.sendString(query);
     await searchCompletedPromise;
 
-    is_element_hidden(bcsElem, "browserContainersSettings should not be in search results");
+    is_element_hidden(suhElem, "showUpdateHistory should not be in search results");
   }
 
   await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 
   // Now, let's add the l10n id to the element and perform the same search again.
 
   await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
 
   {
     let searchInput = gBrowser.contentDocument.getElementById("searchInput");
 
     is(searchInput, gBrowser.contentDocument.activeElement.closest("#searchInput"),
       "Search input should be focused when visiting preferences");
 
-    let bcsElem = gBrowser.contentDocument.getElementById("browserContainersSettings");
-    bcsElem.setAttribute("search-l10n-ids", l10nId);
+    let suhElem = gBrowser.contentDocument.getElementById("showUpdateHistory");
+    suhElem.setAttribute("search-l10n-ids", l10nId);
 
     let query = "Language";
     let searchCompletedPromise = BrowserTestUtils.waitForEvent(
         gBrowser.contentWindow, "PreferencesSearchCompleted", evt => evt.detail == query);
     EventUtils.sendString(query);
     await searchCompletedPromise;
 
-    is_element_visible(bcsElem, "browserContainersSettings should be in search results");
+    is_element_visible(suhElem, "showUpdateHistory should be in search results");
   }
 
   await BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });