Skip to content

Commit

Permalink
text input: modified test to include new text input type. Feature req…
Browse files Browse the repository at this point in the history
…uest jquery-archive#1834 - clear input button for text inputs
  • Loading branch information
Collin F committed Nov 13, 2012
1 parent eeb69a0 commit b624b6f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/unit/textinput/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ <h2 id="qunit-userAgent"></h2>
<textarea id="destroycorrectly">Test Value</textarea>

<input type="search" id="search-input">

<input type="text" id="text-input">

<textarea data-clear-btn="true" id="textarea-clear-button"></textarea>
</div>
</body>
</html>
8 changes: 8 additions & 0 deletions tests/unit/textinput/textinput_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,12 @@
test( "'clear text' button for search inputs should use configured text", function(){
strictEqual( $( "#search-input" ).closest( ".ui-input-search" ).find( ".ui-input-clear" ).attr( "title" ), "custom value" );
});

test( "inputs [type='text'] have clear text button by default", function() {
ok( $( '#text-input' ).next( 'a.ui-input-clear' ), "input of type=text have clear button by default" );
});

test( "data-clear-btn adds clear text button to inputs", function() {
ok( $( "#textarea-clear-button" ).next( "a.ui-input-clear" ), "textarea with data-clear-btn=true has clear button" );
});
})(jQuery);

0 comments on commit b624b6f

Please sign in to comment.