Commit d5b16d81 authored by Emily McMinn's avatar Emily McMinn
Browse files

Bug 1824948 - Remove about:firefoxview link from Gratitude screen r=pdahiya,omc-reviewers, a=dsmith

parent 0d2b472b
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -364,16 +364,7 @@ const MR_ABOUT_WELCOME_DEFAULT = {
        },
        primary_button: {
          label: {
            string_id: "mr2022-onboarding-gratitude-primary-button-label",
          },
          action: {
            type: "OPEN_FIREFOX_VIEW",
            navigate: true,
          },
        },
        secondary_button: {
          label: {
            string_id: "mr2022-onboarding-gratitude-secondary-button-label",
            string_id: "mr2-onboarding-start-browsing-button-label",
          },
          action: {
            navigate: true,
+14 −22
Original line number Diff line number Diff line
@@ -3,12 +3,6 @@
const { AboutWelcomeParent } = ChromeUtils.import(
  "resource:///actors/AboutWelcomeParent.jsm"
);
const {
  assertFirefoxViewTabSelected,
  closeFirefoxViewTab,
} = ChromeUtils.importESModule(
  "resource://testing-common/FirefoxViewTestUtils.sys.mjs"
);
const { AboutWelcomeDefaults } = ChromeUtils.import(
  "resource://activity-stream/aboutwelcome/lib/AboutWelcomeDefaults.jsm"
);
@@ -243,7 +237,7 @@ add_task(async function test_aboutwelcome_mr_template_get_started() {
  await popPrefs();
});

add_task(async function test_aboutwelcome_show_firefox_view() {
add_task(async function test_aboutwelcome_gratitude() {
  const TEST_CONTENT = [
    {
      id: "AW_GRATITUDE",
@@ -264,15 +258,6 @@ add_task(async function test_aboutwelcome_show_firefox_view() {
          label: {
            string_id: "mr2022-onboarding-gratitude-primary-button-label",
          },
          action: {
            type: "OPEN_FIREFOX_VIEW",
            navigate: true,
          },
        },
        secondary_button: {
          label: {
            string_id: "mr2022-onboarding-gratitude-secondary-button-label",
          },
          action: {
            navigate: true,
          },
@@ -286,19 +271,26 @@ add_task(async function test_aboutwelcome_show_firefox_view() {
  // execution
  await test_screen_content(
    browser,
    "doesn't render secondary button on gratitude screen",
    //Expected selectors
    ["main.UPGRADE_GRATITUDE"],
    ["main.AW_GRATITUDE", "button[value='primary_button']"],

    //Unexpected selectors:
    []
    ["button[value='secondary_button']"]
  );
  await clickVisibleButton(browser, ".action-buttons button.primary");

  // verification
  await BrowserTestUtils.waitForEvent(gBrowser, "TabSwitchDone");
  assertFirefoxViewTabSelected(gBrowser.ownerGlobal);
  // make sure the button navigates to newtab
  await test_screen_content(
    browser,
    //Expected selectors
    ["body.activity-stream"],

    //Unexpected selectors:
    ["main.AW_GRATITUDE"]
  );

  // cleanup
  await SpecialPowers.popPrefEnv(); // for setAboutWelcomeMultiStage
  closeFirefoxViewTab(gBrowser.ownerGlobal);
  await cleanup();
});