diff --git a/browser/components/firefoxview/tab-pickup-container.mjs b/browser/components/firefoxview/tab-pickup-container.mjs index 1c1562f66ada..f554298a2a3f 100644 --- a/browser/components/firefoxview/tab-pickup-container.mjs +++ b/browser/components/firefoxview/tab-pickup-container.mjs @@ -44,6 +44,12 @@ class TabPickupContainer extends HTMLDetailsElement { this.addEventListener("visibilitychange", this); Services.obs.addObserver(this.boundObserve, TOPIC_SETUPSTATE_CHANGED); + for (let elem of this.querySelectorAll("a[data-support-url]")) { + elem.href = + Services.urlFormatter.formatURLPref("app.support.baseURL") + + elem.dataset.supportUrl; + } + // we wait until the list shows up before trying to populate it, // when its safe to assume the custom-element's methods will be available this.tabListAdded = this.promiseChildAdded(); diff --git a/browser/components/firefoxview/tests/browser/browser_setup_state.js b/browser/components/firefoxview/tests/browser/browser_setup_state.js index ddc55c025e90..2e4921b4bf95 100644 --- a/browser/components/firefoxview/tests/browser/browser_setup_state.js +++ b/browser/components/firefoxview/tests/browser/browser_setup_state.js @@ -143,7 +143,6 @@ add_task(async function test_signed_in() { await waitForVisibleSetupStep(browser, { expectedVisible: "#tabpickup-steps-view2", }); - is( fxAccounts.device.recentDeviceList?.length, 1, @@ -182,6 +181,33 @@ add_task(async function test_signed_in() { await tearDown(sandbox); }); +add_task(async function test_support_links() { + await clearAllParentTelemetryEvents(); + setupMocks({ + state: UIState.STATUS_SIGNED_IN, + fxaDevices: [ + { + id: 1, + name: "This Device", + isCurrentDevice: true, + type: "desktop", + }, + ], + }); + await withFirefoxView({ win: window }, async browser => { + Services.obs.notifyObservers(null, UIState.ON_UPDATE); + await waitForVisibleSetupStep(browser, { + expectedVisible: "#tabpickup-steps-view2", + }); + const { document } = browser.contentWindow; + const container = document.getElementById("tab-pickup-container"); + const supportLinks = Array.from( + container.querySelectorAll("a[href]") + ).filter(a => !!a.href); + is(supportLinks.length, 2, "Support links have non-empty hrefs"); + }); +}); + add_task(async function test_2nd_desktop_connected() { const sandbox = setupMocks({ state: UIState.STATUS_SIGNED_IN,