mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-09 15:14:44 +00:00
Added unit tests for issue #1405
This commit is contained in:
parent
9f3836e7b1
commit
e39a320214
2 changed files with 62 additions and 0 deletions
|
|
@ -247,6 +247,17 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="active-state-page1" data-nstest-role="page">
|
||||||
|
<div data-nstest-role="content">
|
||||||
|
<a href="#active-state-page2" data-nstest-role="button">page2</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="active-state-page2" data-nstest-role="page">
|
||||||
|
<div data-nstest-role="content">
|
||||||
|
<a href="#active-state-page1" data-nstest-role="button">href button</a>
|
||||||
|
<a href="#active-state-page1" data-nstest-rel="back" data-nstest-role="button">back button</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -608,4 +608,55 @@
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
asyncTest( "handling of active button state when navigating", 1, function(){
|
||||||
|
|
||||||
|
$.testHelper.pageSequence([
|
||||||
|
// open our test page
|
||||||
|
function(){
|
||||||
|
$.testHelper.openPage("#active-state-page1");
|
||||||
|
},
|
||||||
|
|
||||||
|
function(){
|
||||||
|
$("#active-state-page1 a").eq(0).click();
|
||||||
|
},
|
||||||
|
|
||||||
|
function(){
|
||||||
|
$("#active-state-page2 a").eq(0).click();
|
||||||
|
},
|
||||||
|
|
||||||
|
function(){
|
||||||
|
ok(!$("#active-state-page1 a").hasClass( $.mobile.activeBtnClass ), "No button should not have class " + $.mobile.activeBtnClass );
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
asyncTest( "handling of button active state when navigating by clicking back button", 1, function(){
|
||||||
|
|
||||||
|
$.testHelper.pageSequence([
|
||||||
|
// open our test page
|
||||||
|
function(){
|
||||||
|
$.testHelper.openPage("#active-state-page1");
|
||||||
|
},
|
||||||
|
|
||||||
|
function(){
|
||||||
|
$("#active-state-page1 a").eq(0).click();
|
||||||
|
},
|
||||||
|
|
||||||
|
function(){
|
||||||
|
$("#active-state-page2 a").eq(1).click();
|
||||||
|
},
|
||||||
|
|
||||||
|
function(){
|
||||||
|
$("#active-state-page1 a").eq(0).click();
|
||||||
|
},
|
||||||
|
|
||||||
|
function(){
|
||||||
|
ok(!$("#active-state-page2 a").hasClass( $.mobile.activeBtnClass ), "No button should not have class " + $.mobile.activeBtnClass );
|
||||||
|
start();
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue