-
Notifications
You must be signed in to change notification settings - Fork 8
/
test.html
53 lines (44 loc) · 1.8 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Super Awesome Test Runner</title>
</head>
<body>
<div data-view-single="single" id="single"></div>
<div data-view-multiple='{"className":"first"}' id="first"></div>
<div data-view-multiple='{"className":"second"}' id="second"></div>
<div id="scoped">
<div data-view-multiple='{"className":"third"}' id="third"></div>
</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" );
var setupMultiple = function ( $el, el, props ) {
$el.addClass("multiple-ready").addClass("multiple-" + props.className);
};
viewloader.execute({
single: function ( $el, el, props ) {
$el.addClass(props + "-ready");
},
multiple: setupMultiple,
noMansLand: function( $el, el, props) {
$el.addClass("no-mans-land-ready");
}
});
viewloader.execute({
multiple: setupMultiple
}, $("scoped"))
results.innerHTML += $(".single-ready").length === 1 ? "pass" : "FAAAAIL";
results.innerHTML += $(".multiple-ready").length === 3 ? "pass" : "FAAAAIL";
results.innerHTML += $(".multiple-first").length === 1 ? "pass" : "FAAAAIL";
results.innerHTML += $(".multiple-second").length === 1 ? "pass" : "FAAAAIL";
results.innerHTML += $("#scoped .multiple-third").length === 1 ? "pass" : "FAAAAIL";
results.innerHTML += $(".no-mans-land-ready").length === 0 ? "pass" : "FAAAAIL";
</script>
</body>
</html>