Skip to content

Commit 89b7399

Browse files
committed
test for enhancement with nested input
1 parent 77bfb5a commit 89b7399

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

tests/unit/checkboxradio/checkboxradio_core.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,4 +249,16 @@
249249
ok( e.toString().indexOf( "[checkboxradio]" ) >= 0, "checkboxradio exception raised" );
250250
}
251251
});
252+
253+
test( "nested label checkbox still renders", function() {
254+
var $checkbox = $( "#checkbox-nested-label" );
255+
256+
try {
257+
$checkbox.checkboxradio();
258+
} catch (e) {
259+
ok( false, "checkboxradio exception raised: " + e.toString());
260+
}
261+
262+
ok( $checkbox.parent().hasClass("ui-checkbox"), "enhancement has occured");
263+
});
252264
})(jQuery);

tests/unit/checkboxradio/index.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,17 @@ <h2 id="qunit-userAgent"></h2>
167167
</div>
168168

169169
<div id="exception-test">
170-
<input type="checkbox" name="checkbox-exception" id="checkbox-exception" class="custom"/>
170+
<form>
171+
<input type="checkbox" name="checkbox-exception" id="checkbox-exception" class="custom"/>
172+
</form>
173+
</div>
174+
175+
<div id="nested-label-test">
176+
<form>
177+
<label for="checkbox-nested-label">
178+
<input type="checkbox" name="checkbox-nested-label" id="checkbox-nested-label" class="custom"/>
179+
</label>
180+
</form>
171181
</div>
172182
</body>
173183
</html>

0 commit comments

Comments
 (0)