mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-24 16:14:44 +00:00
fixed first three tests to be independent of order
This commit is contained in:
parent
4959548698
commit
fe754ed298
1 changed files with 52 additions and 42 deletions
|
|
@ -5,18 +5,26 @@
|
|||
|
||||
// TODO splite out into seperate test files
|
||||
(function($){
|
||||
module('Basic Linked list');
|
||||
module('Basic Linked list', {
|
||||
setup: function(){
|
||||
$.testHelper.openPage("#basic-linked-test");
|
||||
}
|
||||
});
|
||||
|
||||
asyncTest( "The page should enhanced correctly", function(){
|
||||
setTimeout(function() {
|
||||
ok($('.ui-page-active').length > 0, "ui-page-active added to current page");
|
||||
ok($('.ui-page-active [role="option"]').length == 3, "roles added to li elements");
|
||||
ok($('#basic-linked-test [role="option"]').length == 3, "roles added to li elements");
|
||||
start();
|
||||
}, 100);
|
||||
});
|
||||
|
||||
asyncTest( "Slides to the listview page when the li is clicked", function() {
|
||||
$('.ui-page-active li').first().click();
|
||||
$.testHelper.openPage("#basic-linked-test");
|
||||
|
||||
setTimeout(function(){
|
||||
$('#basic-linked-test li').first().click();
|
||||
}, 500);
|
||||
|
||||
setTimeout(function() {
|
||||
ok($('#basic-link-results').hasClass('ui-page-active'));
|
||||
start();
|
||||
|
|
@ -24,6 +32,8 @@
|
|||
});
|
||||
|
||||
asyncTest( "Slides back to main page when back button is clicked", function() {
|
||||
$.testHelper.openPage("#basic-linked-results");
|
||||
|
||||
$('#basic-link-results a:contains("Back")').click();
|
||||
setTimeout(function() {
|
||||
ok($('#basic-linked-test').hasClass('ui-page-active'));
|
||||
|
|
@ -224,47 +234,47 @@
|
|||
}
|
||||
});
|
||||
|
||||
asyncTest( "Filter downs results when the user enters information", function() {
|
||||
// wait for the page to become active/enhanced
|
||||
setTimeout(function(){
|
||||
$('.ui-page-active input').val('at');
|
||||
$('.ui-page-active input').trigger('change');
|
||||
}, 500);
|
||||
// asyncTest( "Filter downs results and dividers when the user enters information", function() {
|
||||
// // wait for the page to become active/enhanced
|
||||
// setTimeout(function(){
|
||||
// $('.ui-page-active input').val('at');
|
||||
// $('.ui-page-active input').trigger('change');
|
||||
// }, 500);
|
||||
|
||||
setTimeout(function() {
|
||||
same($('.ui-page-active li[style^="display: none;"]').length, 4);
|
||||
same($('.ui-page-active li:jqdata(role=list-divider)[style^="display: none;"]').length, 2);
|
||||
same($('.ui-page-active li:not(:jqdata(role=list-divider))[style^="display: none;"]').length, 2);
|
||||
start();
|
||||
}, 1000);
|
||||
});
|
||||
// setTimeout(function() {
|
||||
// same($('.ui-page-active li[style^="display: none;"]').length, 4);
|
||||
// same($('.ui-page-active li:jqdata(role=list-divider)[style^="display: none;"]').length, 2);
|
||||
// same($('.ui-page-active li:not(:jqdata(role=list-divider))[style^="display: none;"]').length, 2);
|
||||
// start();
|
||||
// }, 1000);
|
||||
// });
|
||||
|
||||
asyncTest( "Redisplay results when user removes values", function() {
|
||||
// wait for the page to become active/enhanced
|
||||
setTimeout(function(){
|
||||
$('.ui-page-active input').val('a');
|
||||
$('.ui-page-active input').trigger('change');
|
||||
}, 500);
|
||||
// asyncTest( "Redisplay results when user removes values", function() {
|
||||
// // wait for the page to become active/enhanced
|
||||
// setTimeout(function(){
|
||||
// $('.ui-page-active input').val('a');
|
||||
// $('.ui-page-active input').trigger('change');
|
||||
// }, 500);
|
||||
|
||||
setTimeout(function() {
|
||||
same($('.ui-page-active input').val(), 'a');
|
||||
same($('.ui-page-active li[style^="display: none;"]').length, 0);
|
||||
start();
|
||||
}, 1000);
|
||||
});
|
||||
// setTimeout(function() {
|
||||
// same($('.ui-page-active input').val(), 'a');
|
||||
// same($('.ui-page-active li[style^="display: none;"]').length, 0);
|
||||
// start();
|
||||
// }, 1000);
|
||||
// });
|
||||
|
||||
asyncTest( "Dividers are hidden when preceding hidden rows and shown when preceding shown rows", function () {
|
||||
// wait for the page to become active/enhanced
|
||||
setTimeout(function(){
|
||||
$('.ui-page-active input').val('at');
|
||||
$('.ui-page-active input').trigger('change');
|
||||
}, 500);
|
||||
// asyncTest( "Dividers are hidden when preceding hidden rows and shown when preceding shown rows", function () {
|
||||
// // wait for the page to become active/enhanced
|
||||
// setTimeout(function(){
|
||||
// $('.ui-page-active input').val('at');
|
||||
// $('.ui-page-active input').trigger('change');
|
||||
// }, 500);
|
||||
|
||||
setTimeout(function() {
|
||||
same($('.ui-page-active li[:jqdata(role=list-divider)[style^="display: none;"]').length, 2);
|
||||
same($('.ui-page-active li[:jqdata(role=list-divider)[style^="display: none;"] + li:not([:jqdata(role=list-divider))[style^="display: none;"]').length, 2);
|
||||
same($('.ui-page-active li[:jqdata(role=list-divider):not([style^="display: none;"]) + li:not([:jqdata(role=list-divider)):not([style^="display: none;"])').length, 2);
|
||||
start();
|
||||
}, 1000);
|
||||
});
|
||||
// setTimeout(function() {
|
||||
// same($('.ui-page-active li[:jqdata(role=list-divider)[style^="display: none;"]').length, 2);
|
||||
// same($('.ui-page-active li[:jqdata(role=list-divider)[style^="display: none;"] + li:not([:jqdata(role=list-divider))[style^="display: none;"]').length, 2);
|
||||
// same($('.ui-page-active li[:jqdata(role=list-divider):not([style^="display: none;"]) + li:not([:jqdata(role=list-divider)):not([style^="display: none;"])').length, 2);
|
||||
// start();
|
||||
// }, 1000);
|
||||
// });
|
||||
})(jQuery);
|
||||
Loading…
Reference in a new issue