1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4
<title>Scrollview List Plugin Tests</title>
5
<script type="text/javascript" src="../../../build/yui/yui-min.js"></script>
8
<body class="yui3-skin-sam">
9
<h1>Scrollview List Plugin Tests</h1>
14
<div id="scrollable1" class="yui3-scrollview-loading">
17
<div>I am a div with some LI content inside me!
19
<li class="special">LI content 1</li>
20
<li class="special">LI Content 2</li>
21
<li class="special">LI Content 3</li>
41
<div>Blue October</div>
50
<div>Citizen Cope</div>
59
<div>I am a div with some LI content inside me!
61
<li class="special">LI content 1</li>
62
<li class="special">LI Content 2</li>
63
<li class="special">LI Content 3</li>
71
<div>Purchased on the iPhone</div>
89
<div>I am a div with some LI content inside me!
91
<li class="special">LI content 1</li>
92
<li class="special">LI Content 2</li>
93
<li class="special">LI Content 3</li>
104
<div>Citizen Cope</div>
113
<div>Foo Fighters</div>
116
<div>Lily Allen</div>
124
<h1>Scrollview 2 - has divs as immediate children</h1>
126
<div id="scrollable2" class="yui3-scrollview-loading">
128
<div>I am a div with some LI content inside me!
130
<li>LI content 1</li>
131
<li>LI Content 2</li>
132
<li>LI Content 3</li>
138
<div>I am a div with some LI content inside me!
140
<li>LI content 1</li>
141
<li>LI Content 2</li>
142
<li>LI Content 3</li>
147
<div>Lily Allen</div>
150
<div>Purchased on the iPhone</div>
165
<div>Ben Harper</div>
168
<div>I am a div with some LI content inside me!
170
<li>LI content 1</li>
171
<li>LI Content 2</li>
172
<li>LI Content 3</li>
183
<div>Citizen Cope</div>
192
<div>Foo Fighters</div>
195
<div>Lily Allen</div>
204
<script type="text/javascript">
207
filter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'min',
209
}).use("console", "test", "dump", "scrollview-base", 'scrollview-list', function(Y) {
213
var ASSERT = Y.Assert,
214
ARRAYASSERT = Y.ArrayAssert;
216
var myConsole = new Y.Console().render();
219
var testBasic = new Y.Test.Case({
223
contentBox: '#scrollable1',
230
plugins: [Y.Plugin.ScrollViewList]
234
contentBox: '#scrollable2',
241
plugins: [Y.Plugin.ScrollViewList]
244
//---------------------------------------------
245
// Setup and tear down
246
//---------------------------------------------
248
setUp : function () {
252
tearDown : function () {
257
//---------------------------------------------
259
//---------------------------------------------
261
//makes sure only immediate decendant LI and UL's are selected
262
testBasicScrollviewList: function() {
264
var sv = new Y.ScrollView(this.svCfg1),
265
cb, id, ul, li, className, special;
269
cb = sv.get('contentBox');
272
ul = Y.all('#'+ id +' > ul')
273
li = Y.all('#'+ id +' > ul > li');
274
special = Y.all('.special');
276
ul.each(function(item) {
277
className = item.getAttribute('class');
279
Y.Assert.areEqual("yui3-scrollview-list", className, "List Class name not equal");
282
li.each(function(item) {
283
className = item.getAttribute('class');
285
Y.Assert.areEqual("yui3-scrollview-item", className, "Item Class name not equal");
288
special.each(function(item) {
289
Y.log('checked specials');
290
Y.Assert.isFalse(item.hasClass('yui3-scrollview-item'), "Special LIs should not have class");
295
testScrollviewListWithDiv: function() {
296
var sv = new Y.ScrollView(this.svCfg2),
299
cb = sv.get('contentBox');
302
li = Y.all('#' + id + ' li');
304
li.each(function(item) {
306
Y.Assert.isFalse(item.hasClass('yui3-scrollview-item'), "these LIs should not have class because they are not immediate decendants");
316
var suite = new Y.Test.Suite({name:"Scrollview List Test Suite"});
317
suite.add(testBasic);
319
Y.Test.Runner.setName("Scrollview Test Runner");
320
Y.Test.Runner.add(suite);