Skip to content

Commit

Permalink
[atoms] Adding tests for bot.dom.isEditable
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Sep 30, 2018
1 parent 3e16812 commit d47851c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions javascript/atoms/test/dom_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
<title>dom_test</title>
<script src="test_bootstrap.js"></script>
<script type="text/javascript">
goog.require('bot.dom');
goog.require('bot.dom.core');
goog.require('bot.userAgent');
goog.require('goog.testing.jsunit');
goog.require('goog.userAgent');
</script>
<body>
<script type="text/javascript">
var INPUT_IDS = ['text', 'search', 'tel', 'url', 'email', 'password', 'number',
'range', 'date', 'month', 'week', 'time', 'datetime-local', 'color'];

function testStandardizeStyleAttributeReturnsIdenticalStringWithLowercasedPropertyNames() {
var toTest = [
{input: "Left: 0px; Text-align: center;",
Expand Down Expand Up @@ -68,7 +72,30 @@
bot.dom.core.standardizeStyleAttribute_(toTest[i].input));
}
}

function testEditableFields() {
for (var i = 0; i < INPUT_IDS.length; i++) {
var inputBox = document.getElementById(INPUT_IDS[i]);
assertTrue(INPUT_IDS[i], bot.dom.isEditable(inputBox));
}
}
</script>
<form action="" onsubmit="return false;">
<input type="text" id="text"/>
<input type="search" id="search"/>
<input type="tel" id="tel"/>
<input type="url" id="url"/>
<input type="email" id="email"/>
<input type="password" id="password"/>
<input type="number" id="number"/>
<input type="range" id="range"/>
<input type="date" id="date"/>
<input type="month" id="month"/>
<input type="week" id="week"/>
<input type="time" id="time"/>
<input type="datetime-local" id="datetime-local"/>
<input type="color" id="color"/>
</form>
</body>
</html>

0 comments on commit d47851c

Please sign in to comment.