forked from google/jsaction
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdom_test.js
More file actions
25 lines (19 loc) · 766 Bytes
/
dom_test.js
File metadata and controls
25 lines (19 loc) · 766 Bytes
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
// Copyright 2013 Google Inc. All Rights Reserved.
/** @suppress {extraProvide} */
goog.provide('jsaction.domTest');
goog.setTestOnly('jsaction.domTest');
goog.require('goog.testing.jsunit');
goog.require('jsaction.dom');
function testContains() {
var root = document.createElement('div');
var child = document.createElement('div');
var subchild = document.createElement('div');
child.appendChild(subchild);
root.appendChild(child);
assertTrue(jsaction.dom.contains(root, root));
assertTrue(jsaction.dom.contains(root, child));
assertTrue(jsaction.dom.contains(root, subchild));
assertTrue(jsaction.dom.contains(child, subchild));
assertFalse(jsaction.dom.contains(subchild, root));
assertFalse(jsaction.dom.contains(subchild, child));
}