summaryrefslogtreecommitdiffstats
path: root/toolkit/components/messaging-system/schemas/SpecialMessageActionSchemas/test/browser/browser_sma_open_protection_panel.js
blob: c9522426a2c717b0db90627efd0f4762ffd77008 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

add_task(async function test_OPEN_PROTECTION_PANEL() {
  await BrowserTestUtils.withNewTab(EXAMPLE_URL, async browser => {
    const popupshown = BrowserTestUtils.waitForEvent(
      window,
      "popupshown",
      true,
      e => e.target.id == "protections-popup"
    );

    await SMATestUtils.executeAndValidateAction({
      type: "OPEN_PROTECTION_PANEL",
    });

    let { target: popupEl } = await popupshown;
    Assert.equal(popupEl.state, "open", "Protections popup is open.");
  });
});