test for issue 2410, to verify that the button value is updated on refresh with new options

This commit is contained in:
John Bender 2011-09-09 09:11:38 -07:00
parent 729757b465
commit fab4f366a4
2 changed files with 19 additions and 1 deletions

View file

@ -321,8 +321,12 @@
<option value="long">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</option>
</select>
</div>
</div>
<select name="native-refresh" id="native-refresh">
<option value="-1">default</option>
<option value="-1">other</option>
</select>
</div>
<div id="enhancetest">
@ -333,5 +337,6 @@
<option value="overnight">Overnight</option>
</select>
</div>
</body>
</html>

View file

@ -44,4 +44,17 @@
}
], 300);
});
// issue https://github.com/jquery/jquery-mobile/issues/2410
test( "adding options and refreshing a native select defaults the text", function() {
var select = $( "#native-refresh" ),
button = select.siblings( '.ui-btn-inner' ),
text = "foo";
same(button.text(), "default");
select.find( "option" ).remove(); //remove the loading message
select.append('<option value="1">' + text + '</option>');
select.selectmenu('refresh');
same(button.text(), text);
});
})(jQuery);