diff options
Diffstat (limited to 'devtools/client/jsonview/test/browser_jsonview_object-type.js')
-rw-r--r-- | devtools/client/jsonview/test/browser_jsonview_object-type.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/devtools/client/jsonview/test/browser_jsonview_object-type.js b/devtools/client/jsonview/test/browser_jsonview_object-type.js new file mode 100644 index 0000000000..08b9ed865c --- /dev/null +++ b/devtools/client/jsonview/test/browser_jsonview_object-type.js @@ -0,0 +1,25 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const { ELLIPSIS } = require("resource://devtools/shared/l10n.js"); + +add_task(async function () { + info("Test Object type property started"); + + const TEST_JSON_URL = 'data:application/json,{"x":{"type":"string"}}'; + await addJsonViewTab(TEST_JSON_URL); + + let count = await getElementCount(".jsonPanelBox .treeTable .treeRow"); + is(count, 2, "There must be two rows"); + + // Collapse auto-expanded node. + await clickJsonNode(".jsonPanelBox .treeTable .treeLabel"); + + count = await getElementCount(".jsonPanelBox .treeTable .treeRow"); + is(count, 1, "There must be one row"); + + const label = await getElementText(".jsonPanelBox .treeTable .objectCell"); + is(label, `{${ELLIPSIS}}`, "The label must be indicating an object"); +}); |