selector_new.html revision c28f85fdfe5f4318a887f384ac1e58d40414fdba
<html>
<head>
<title>Selector Test Suite</title>
<script>
YUI({ base: '/build/', filter: 'raw' }).use('console-filters', 'test', function(Y) {
var testSuite = new Y.Test.Suite("Selector Test Suite"),
doc = document,
$ = Y.Selector.query;
Y.DOM.byTag = function (tag, root, test) {
var els = (root || document).getElementsByTagName(tag),
nodes = [],
i, len;
if (!test || test(els[i])) {
}
}
return nodes;
};
//Y.config.useBrowserConsole = false;
expected = expected || [];
var actual = $(selector, root, firstOnly),
if (firstOnly) {
expected = expected[0] ? expected[0] : null;
} else {
}
};
nullInput: function(root, firstOnly) {
var q = '';
q = null;
q = null;
},
tag: {
'fake': []
},
className: {
'.heading': function() {
});
},
'.fake-class': []
},
id: {
'#fake-id': []
},
combo: {
'h1.heading': function() {
});
},
'div.heading': [],
'h1.heading#fake-id': [],
'h1.fake-class#only-h1': [],
'faketag.fake-class#only-h1': []
},
group: {
'h1, h2': function() {
});
},
'h1, .heading': function() {
});
},
'h2, h1': function() {
});
},
'h2.heading, h1.heading': function() {
});
},
},
complex: {
'foo .first-child h1': [],
}
};
//create the console
height: '90%',
node: '#test-logger',
newestOnTop : false,
plugins: [Y.Plugin.ConsoleFilters]
}).render();
if (typeof test === 'function') {
test(doc);
};
test(doc.body);
};
};
test(doc, true);
};
};
};
} else {
testCase = 'test: ' + query;
};
};
};
};
};
};
});
}
});
Y.Test.Runner.add(testSuite);
});
</script>
</head>
<body class="yui3-skin-sam" id="only-body">
<div id="first-child-of-body">
<div class="first-child" id="test-root">
<h1 class="heading h1 first-child" id="only-h1"><em>Selector Test Suite</em></h1>
<h2 class="heading h2">Testing 1</h2>
<h2 class="heading h2">Testing 2</h2>
<h2 class="heading h2">Testing 3</h2>
</div>
</div>
.yui-console-entry-src {
display: none;
}
.yui-skin-sam .yui-console-entry-pass .yui-console-entry-cat {
background: #070;
color: #fff;
}
.yui-skin-sam .yui-console-entry-fail .yui-console-entry-cat {
background: #700;
color: #fff;
}
.yui3-skin-sam .yui3-console-entry {
padding: 0 !important;
}
.yui3-skin-sam .yui3-console-entry .yui3-console-entry-content {
margin:0 !important;
}
</style>
<div id="test-logger" class="last-child child-of-body"></div>
</body>
</html>