summaryrefslogtreecommitdiffstats
path: root/browser/components/newtab/test/browser/browser_discovery_render.js
blob: 86b0410698bc005dbda490d6deef315c9cc21381 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"use strict";

async function before({ pushPrefs }) {
  await pushPrefs([
    "browser.newtabpage.activity-stream.discoverystream.config",
    JSON.stringify({
      collapsible: true,
      enabled: true,
      hardcoded_layout: true,
    }),
  ]);
}

test_newtab({
  before,
  test: async function test_render_hardcoded_topsites() {
    const topSites = await ContentTaskUtils.waitForCondition(() =>
      content.document.querySelector(".ds-top-sites")
    );
    ok(topSites, "Got the discovery stream top sites section");
  },
});

test_newtab({
  before,
  test: async function test_render_hardcoded_learnmore() {
    const learnMoreLink = await ContentTaskUtils.waitForCondition(() =>
      content.document.querySelector(".ds-layout .learn-more-link > a")
    );
    ok(learnMoreLink, "Got the discovery stream learn more link");
  },
});