summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/compatibility/test/browser/browser_compatibility_unsupported-browsers_some.js
blob: 6359b34e31a59b3111e5c6b028433d9448259908 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

// Test whether some of browsers are unsupported.

const {
  updateTargetBrowsers,
} = require("resource://devtools/client/inspector/compatibility/actions/compatibility.js");

const TEST_URI = `
  <style>
  body {
    border-block-color: lime;
  }
  </style>
  <body></body>
`;

const TARGET_BROWSERS = [
  { id: "firefox", name: "Firefox", version: "1" },
  { id: "firefox", name: "Firefox", version: "70" },
  { id: "firefox_android", name: "Firefox Android", version: "1" },
  { id: "firefox_android", name: "Firefox Android", version: "70" },
];

add_task(async function () {
  await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
  const { inspector, selectedElementPane } = await openCompatibilityView();

  info("Update the target browsers for this test");
  await inspector.store.dispatch(updateTargetBrowsers(TARGET_BROWSERS));

  info("Check the content of the issue item");
  const expectedIssues = [
    {
      property: "border-block-color",
      unsupportedBrowsers: [
        { id: "firefox", name: "Firefox", version: "1" },
        { id: "firefox_android", name: "Firefox Android", version: "1" },
      ],
      url: "https://developer.mozilla.org/docs/Web/CSS/border-block-color",
    },
  ];
  await assertIssueList(selectedElementPane, expectedIssues);
});