4 Test that children pointers show up at the correct times.
8 <title>Tree component test
</title>
9 <script src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"chrome://mochikit/content/tests/SimpleTest/test.css">
13 <!-- Give the container height so that the whole tree is rendered. -->
14 <div id=
"container" style=
"height: 900px;"></div>
17 <script src=
"head.js" type=
"application/javascript"></script>
18 <script type=
"application/javascript">
20 window.onload = async function() {
22 const container = document.getElementById(
"container");
24 await renderComponent(CensusTreeItem(immutableUpdate(TEST_CENSUS_TREE_ITEM_PROPS, {
29 ok(!container.querySelector(
".children-pointer"),
30 "Don't show children pointer for roots when we are inverted");
32 await renderComponent(CensusTreeItem(immutableUpdate(TEST_CENSUS_TREE_ITEM_PROPS, {
37 ok(container.querySelector(
".children-pointer"),
38 "Do show children pointer for non-roots when we are inverted");
40 await renderComponent(CensusTreeItem(immutableUpdate(TEST_CENSUS_TREE_ITEM_PROPS, {
42 item: immutableUpdate(TEST_CENSUS_TREE_ITEM_PROPS.item, { children: undefined }),
45 ok(!container.querySelector(
".children-pointer"),
46 "Don't show children pointer when non-inverted and no children");
48 await renderComponent(CensusTreeItem(immutableUpdate(TEST_CENSUS_TREE_ITEM_PROPS, {
51 item: immutableUpdate(TEST_CENSUS_TREE_ITEM_PROPS.item, { children: [{}] }),
54 ok(container.querySelector(
".children-pointer"),
55 "Do show children pointer when non-inverted and have children");
57 ok(false,
"Got an error: " + DevToolsUtils.safeErrorString(e));