Skip to content

Commit

Permalink
Added latest jq version and improved nav tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Angel Sanchez committed Jan 21, 2014
1 parent b5b1102 commit 7c9b184
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
6 changes: 6 additions & 0 deletions libs/jquery-2.0.3.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions libs/jquery-2.0.3.min.map

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions test/enhanced_navigation_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,5 +518,50 @@

});

asyncTest("Navigate to an unregistered screen", function() {
expect(4);

iris.welcome(iris.path.welcome); // +1 create, +1 awake

iris.on(iris.AFTER_NAVIGATION, function () {
iris.off(iris.AFTER_NAVIGATION);

var navigationHash = "#/screen_not_defined";


iris.on(iris.SCREEN_NOT_FOUND, function (invalidHash) {
strictEqual(invalidHash, navigationHash, 'The invalid hash must be equal to SCREEN_NOT_FOUND event parameter'); // +1
strictEqual(window.location.hash, navigationHash, 'The current hash must be equal'); // +1
start();
});

iris.on(iris.AFTER_NAVIGATION, function () {
throw "A navigation event has been raises";
});

iris.navigate(navigationHash);
});

});

asyncTest("Navigate to an unregistered screen whitout initial navigation to welcome screen", function() {
expect(4);

var navigationHash = "#/screen_not_defined";
document.location.hash = navigationHash;

iris.on(iris.SCREEN_NOT_FOUND, function (invalidHash) {
strictEqual(invalidHash, navigationHash, 'The invalid hash must be equal to SCREEN_NOT_FOUND event parameter'); // +1
strictEqual(window.location.hash, navigationHash, 'The current hash must be equal'); // +1
start();
});

iris.on(iris.AFTER_NAVIGATION, function () {
throw "A navigation event has been raises";
});

iris.welcome(iris.path.welcome); // +1 create, +1 awake
});


}(jQuery));
2 changes: 1 addition & 1 deletion test/iris.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>Iris Test Suite</title>
<script src="/libs/jquery-1.8.2.min.js"></script>
<script src="/libs/jquery-2.0.3.min.js"></script>

<!-- Load local QUnit (grunt requires v1.0.0 or newer). -->
<link rel="stylesheet" href="/libs/qunit/qunit.css" media="screen">
Expand Down

0 comments on commit 7c9b184

Please sign in to comment.