summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/compatibility/test/browser/browser_compatibility_issue-node.js
blob: b99dfd4062d2ee0443f9c631e20c7e4fabafadf6 (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
48
49
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

// Test displaying the nodes that caused issues.

const TEST_URI = `
  <style>
  body {
    user-modify: read-only;
  }
  div {
    user-modify: read-only;
    scrollbar-width: thin;
  }
  </style>
  <body>
    <div>div</div>
  </body>
`;

const TEST_DATA_ALL = [
  {
    property: "user-modify",
    nodes: ["body", "div"],
  },
  {
    property: "scrollbar-width",
    nodes: ["div"],
  },
];

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

  const { allElementsPane, selectedElementPane } =
    await openCompatibilityView();

  info("Check nodes that caused issues on the selected element");
  is(
    selectedElementPane.querySelectorAll(".compatibility-node-item").length,
    0,
    "Nodes are not displayed on the selected element"
  );

  info("Check nodes that caused issues on all elements");
  await assertNodeList(allElementsPane, TEST_DATA_ALL);
});