Commit ba01e964 authored by Rob Wu's avatar Rob Wu
Browse files

Bug 1835561 - Restore update-manual message + add test...

Bug 1835561 - Restore update-manual message + add test r=application-update-reviewers,nalexander,fluent-reviewers,flod l10n=flod a=pascalc

Differential Revision: https://phabricator.services.mozilla.com/D179319
parent b877fc2e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ update-noUpdatesFound = { -brand-short-name } is up to date
aboutdialog-update-checking-failed = Failed to check for updates.
update-otherInstanceHandlingUpdates = { -brand-short-name } is being updated by another instance

update-manual = Updates available at <label data-l10n-name="manual-link"/>
aboutdialog-update-manual = Updates available at <a data-l10n-name="manual-link"/>

update-unsupported = You can not perform further updates on this system. <label data-l10n-name="unsupported-link">Learn more</label>
+43 −1
Original line number Diff line number Diff line
@@ -815,7 +815,12 @@ function runAboutDialogUpdateTest(params, steps) {
        await continueFileHandler(continueFile);
      }

      let linkPanels = ["downloadFailed", "manualUpdate", "unsupportedSystem"];
      let linkPanels = [
        "downloadFailed",
        "manualUpdate",
        "unsupportedSystem",
        "internalError",
      ];
      if (linkPanels.includes(panelId)) {
        // The unsupportedSystem panel uses the update's detailsURL and the
        // downloadFailed and manualUpdate panels use the app.update.url.manual
@@ -826,6 +831,24 @@ function runAboutDialogUpdateTest(params, steps) {
          gDetailsURL,
          `The panel's link href should equal ${gDetailsURL}`
        );
        const assertNonEmptyText = (node, description) => {
          let textContent = node.textContent.trim();
          ok(textContent, `${description}, got "${textContent}"`);
        };
        // TODO bug 1835559: Somehow the text content is empty.
        if (panelId !== "internalError") {
          assertNonEmptyText(
            link,
            `The panel's link should have non-empty textContent`
          );
        }
        let linkWrapperClone = link.parentNode.cloneNode(true);
        await link.ownerDocument.l10n.translateFragment(linkWrapperClone);
        linkWrapperClone.querySelector("label.text-link").remove();
        assertNonEmptyText(
          linkWrapperClone,
          `The panel's link should have text around the link`
        );
      }

      // Automatically click the download button unless `noContinue` was passed.
@@ -1104,6 +1127,7 @@ function runAboutPrefsUpdateTest(params, steps) {
            "downloadFailed",
            "manualUpdate",
            "unsupportedSystem",
            "internalError",
          ];
          if (linkPanels.includes(panelId)) {
            let { selectedPanel } = content.gAppUpdater;
@@ -1128,6 +1152,24 @@ function runAboutPrefsUpdateTest(params, steps) {
              gDetailsURL,
              `The panel's link href should equal ${gDetailsURL}`
            );
            const assertNonEmptyText = (node, description) => {
              let textContent = node.textContent.trim();
              ok(textContent, `${description}, got "${textContent}"`);
            };
            // TODO bug 1835559: Somehow the text content is empty.
            if (panelId !== "internalError") {
              assertNonEmptyText(
                link,
                `The panel's link should have non-empty textContent`
              );
            }
            let linkWrapperClone = link.parentNode.cloneNode(true);
            await link.ownerDocument.l10n.translateFragment(linkWrapperClone);
            linkWrapperClone.querySelector(selector).remove();
            assertNonEmptyText(
              linkWrapperClone,
              `The panel's link should have text around the link`
            );
          }

          let buttonPanels = ["downloadAndInstall", "apply"];