Skip to content

Commit

Permalink
Add some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bensmithett committed Oct 11, 2013
1 parent c357b09 commit 8791080
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"license": "MIT",
"ignore": [
"**/.*",
"README.md"
"README.md",
"test.html"
]
}
36 changes: 36 additions & 0 deletions test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Super Awesome Test Runner</title>
</head>
<body>
<div data-view="single" id="single"></div>

<div data-view="multiple" id="first"></div>
<div data-view="multiple" id="second"></div>

<div id="test-results"></div>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.2.min.js"><\/script>')</script>
<script src="viewloader.js"></script>

<script>
var ids = "";
var results = document.getElementById( "test-results" );

viewloader.execute({
single: function ( $el, el ) {
$el.addClass("single-ready");
},
multiple: function ( $el, el ) {
$el.addClass("multiple-ready");
}
});

results.innerHTML += $(".single-ready").length === 1 ? "pass" : "FAAAAIL";
results.innerHTML += $(".multiple-ready").length === 2 ? "pass" : "FAAAAIL";
</script>
</body>
</html>

0 comments on commit 8791080

Please sign in to comment.