-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close #62 - Should handle pages that does not hide on URL changes
- Loading branch information
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
76 changes: 76 additions & 0 deletions
76
test/should_display_multiple_pages_using_url_toggle_show.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Should display multiple pages using URL toggle none</title> | ||
<script type="text/javascript" src="../lib/jquery-1.7.2.min.js"></script> | ||
<script type="text/javascript" src="../lib/underscore-min.js"></script> | ||
<script type="text/javascript" src="../lib/knockout-2.1.0.js"></script> | ||
<script type="text/javascript" src="../lib/jquery.ba-hashchange.min.js"></script> | ||
<script type="text/javascript" src="../pager.js"></script> | ||
|
||
<link rel="stylesheet" href="../lib/qunit.css"/> | ||
</head> | ||
<body> | ||
|
||
<div id="qunit"></div> | ||
|
||
<div data-bind="page: {id: 'a', urlToggle: 'none'}"> | ||
<span id="hej">Hej</span> | ||
</div> | ||
|
||
<div data-bind="page: {id: 'b', urlToggle: 'none'}"> | ||
<span id="hola">Hola</span> | ||
</div> | ||
|
||
<div data-bind="page: {id: 'c', urlToggle: 'none'}"> | ||
<span id="hi">Hi</span> | ||
</div> | ||
|
||
<div data-bind="page: {id: 'c'}"> | ||
<span id="eho">Eho</span> | ||
</div> | ||
|
||
<script type="text/javascript"> | ||
|
||
|
||
var viewModel = { | ||
}; | ||
|
||
pager.extendWithPage(viewModel); | ||
ko.applyBindings(viewModel); | ||
|
||
pager.startHashChange(); | ||
</script> | ||
|
||
<script type="text/javascript" src="../lib/qunit-until.js"></script> | ||
<script type="text/javascript" src="../lib/qunit.js"></script> | ||
|
||
<script type="text/javascript"> | ||
|
||
asyncTest("Should display multiple pages using URL toggle none", function () { | ||
|
||
assert.equal($('#hej').is(':visible'), true, "hej should be visible"); | ||
assert.equal($('#hola').is(':visible'), true, "hola should be visible"); | ||
assert.equal($('#hi').is(':visible'), true, "hi should be visible"); | ||
assert.equal($('#eho').is(':visible'), false, "eho should be hidden"); | ||
|
||
location.hash = '#c'; | ||
|
||
until(function() { | ||
return $('#eho').is(':visible'); | ||
}, function() { | ||
assert.equal($('#hej').is(':visible'), true, "hej should be visible"); | ||
assert.equal($('#hola').is(':visible'), true, "hola should be visible"); | ||
assert.equal($('#hi').is(':visible'), true, "hi should be visible"); | ||
assert.equal($('#eho').is(':visible'), false, "eho should be visible"); | ||
|
||
}); | ||
|
||
start(); | ||
|
||
}); | ||
</script> | ||
|
||
|
||
</body> | ||
</html> |