summaryrefslogtreecommitdiffstats
path: root/toolkit/components/places/tests/unit/test_PlacesUtils_isRootItem.js
blob: f626d437e01d5d345a70bf7a8c5eee2b892ed26e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"use strict";

const GUIDS = [
  PlacesUtils.bookmarks.rootGuid,
  ...PlacesUtils.bookmarks.userContentRoots,
  PlacesUtils.bookmarks.tagsGuid,
];

add_task(async function test_isRootItem() {
  for (let guid of GUIDS) {
    Assert.ok(
      PlacesUtils.isRootItem(guid),
      `Should correctly identify root item ${guid}`
    );
  }

  Assert.ok(
    !PlacesUtils.isRootItem("fakeguid1234"),
    "Should not identify other items as root."
  );
});