Skip to content

Commit d47851c

Browse files
committed
[atoms] Adding tests for bot.dom.isEditable
1 parent 3e16812 commit d47851c

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

‎javascript/atoms/test/dom_test.html‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
<title>dom_test</title>
55
<script src="test_bootstrap.js"></script>
66
<script type="text/javascript">
7+
goog.require('bot.dom');
78
goog.require('bot.dom.core');
89
goog.require('bot.userAgent');
910
goog.require('goog.testing.jsunit');
1011
goog.require('goog.userAgent');
1112
</script>
1213
<body>
1314
<script type="text/javascript">
15+
var INPUT_IDS = ['text', 'search', 'tel', 'url', 'email', 'password', 'number',
16+
'range', 'date', 'month', 'week', 'time', 'datetime-local', 'color'];
17+
1418
function testStandardizeStyleAttributeReturnsIdenticalStringWithLowercasedPropertyNames() {
1519
var toTest = [
1620
{input: "Left: 0px; Text-align: center;",
@@ -68,7 +72,30 @@
6872
bot.dom.core.standardizeStyleAttribute_(toTest[i].input));
6973
}
7074
}
75+
76+
function testEditableFields() {
77+
for (var i = 0; i < INPUT_IDS.length; i++) {
78+
var inputBox = document.getElementById(INPUT_IDS[i]);
79+
assertTrue(INPUT_IDS[i], bot.dom.isEditable(inputBox));
80+
}
81+
}
7182
</script>
83+
<form action="" onsubmit="return false;">
84+
<input type="text" id="text"/>
85+
<input type="search" id="search"/>
86+
<input type="tel" id="tel"/>
87+
<input type="url" id="url"/>
88+
<input type="email" id="email"/>
89+
<input type="password" id="password"/>
90+
<input type="number" id="number"/>
91+
<input type="range" id="range"/>
92+
<input type="date" id="date"/>
93+
<input type="month" id="month"/>
94+
<input type="week" id="week"/>
95+
<input type="time" id="time"/>
96+
<input type="datetime-local" id="datetime-local"/>
97+
<input type="color" id="color"/>
98+
</form>
7299
</body>
73100
</html>
74101

0 commit comments

Comments
 (0)