Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 31b5fe4

Browse files
committed
updated custom selectmenu unit tests to be compliant with new logic
1 parent 9236f20 commit 31b5fe4

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

tests/unit/select/select_cached.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,23 +101,35 @@
101101

102102
asyncTest( "menupage is removed when the parent page is removed", function(){
103103
var dialogCount = $(":jqmData(role='dialog')").length;
104-
105104
$.testHelper.pageSequence([
106105
resetHash,
107106

108107
function(){
109-
110108
$.mobile.changePage( "uncached-dom-cached-false.html" );
111109
},
112110

113111
function(){
114-
same( $(":jqmData(role='dialog')").length, dialogCount + 1 );
112+
// for performance reason we don't initially create the menu dialog now
113+
same( $(":jqmData(role='dialog')").length, dialogCount);
114+
115+
// manually trigger dialog opening
116+
$( "#domcache-uncached-page-select" ).data( 'selectmenu' ).open();
117+
},
118+
119+
function(){
120+
// check if dialog was successfully created
121+
same( $(":jqmData(role='dialog')").length, dialogCount + 1 );
122+
$( "#domcache-uncached-page-select" ).data( 'selectmenu' ).close();
123+
},
124+
125+
function(){
126+
// navigate to parent(initial) page
115127
window.history.back();
116128
},
117-
129+
118130
function() {
119131
same( $(":jqmData(role='dialog')").length, dialogCount );
120-
start();
132+
start();
121133
}
122134
]);
123135
});

tests/unit/select/select_core.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,15 +325,16 @@
325325
});
326326

327327
// issue #2547
328-
test( "custom select list item links have unencoded option text values when using vanilla $.fn.text", function() {
328+
// getEncodedText() is no longer used in _buildList() so we don't need this extra check
329+
/*test( "custom select list item links have unencoded option text values when using vanilla $.fn.text", function() {
329330
// undo our changes, undone in teardown
330331
$.fn.getEncodedText = $.fn.text;
331332
332333
$( "#encoded-option" ).data( 'selectmenu' )._buildList();
333334
334335
same(window.encodedValueIsDefined, true);
335-
});
336-
336+
});*/
337+
337338
$.mobile.page.prototype.options.keepNative = "select.should-be-native";
338339

339340
// not testing the positive case here since's it's obviously tested elsewhere

0 commit comments

Comments
 (0)