classnamemanager.html revision 1bb9ba7f0e700971d0c04fca23820699348cfd49
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
f0356c78ab4c064aefae40965cbaf2b9b92efe99Todd Kloots <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai <script src="/build/yui/yui.js" type="text/javascript"></script>
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai #console .yui3-console-entry {
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai padding:2px;
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai min-height:0;
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai #console .yui3-console-entry-fail .yui3-console-entry-cat {
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai background-color:red;
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai #console .yui3-console-entry-pass .yui3-console-entry-cat {
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai background-color:green;
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai #console .yui3-console-entry-perf .yui3-console-entry-cat {
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai background-color:blue;
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai position:static;
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai html, body {
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai height:100%;
1bb9ba7f0e700971d0c04fca23820699348cfd49Satyen Desai useBrowserConsole:false,
1bb9ba7f0e700971d0c04fca23820699348cfd49Satyen Desai filter: (window.location.search.match(/[?&]filter=([^&]+)/) || [])[1] || 'min'
1bb9ba7f0e700971d0c04fca23820699348cfd49Satyen Desai }).use("test", "classnamemanager", "console", function(Y) {
7d507382f17958718343411514753ac813c037acSatyen Desai var testClassNameManager = new Y.Test.Case({
7d507382f17958718343411514753ac813c037acSatyen Desai name: "ClassNameManager Tests",
7d507382f17958718343411514753ac813c037acSatyen Desai testSingleSection: function() {
7d507382f17958718343411514753ac813c037acSatyen Desai Y.Assert.areEqual(Y.ClassNameManager.getClassName("menuitem"), "yui3-menuitem");
7d507382f17958718343411514753ac813c037acSatyen Desai testSingleSectionNoPrefix: function() {
7d507382f17958718343411514753ac813c037acSatyen Desai Y.Assert.areEqual(Y.ClassNameManager.getClassName("menuitem", true), "menuitem");
7d507382f17958718343411514753ac813c037acSatyen Desai testMoreThanOneSection : function() {
7d507382f17958718343411514753ac813c037acSatyen Desai Y.Assert.areEqual(Y.ClassNameManager.getClassName("menuitem", "active"), "yui3-menuitem-active");
7d507382f17958718343411514753ac813c037acSatyen Desai testMoreThanOneSectionNoPrefix : function() {
7d507382f17958718343411514753ac813c037acSatyen Desai Y.Assert.areEqual(Y.ClassNameManager.getClassName("menuitem", "active", true), "menuitem-active");
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai var suite = new Y.Test.Suite("ClassNameManager Tests");
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai suite.add(new Y.Test.Case(testClassNameManager));
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai Y.Test.Runner.setName("ClassNameManager Tests");
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai var console;
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai Y.one("#btnRun").set("disabled", false).on("click", function() {
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai if (!console) {
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai console = new Y.Console({
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai id:"console",
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai width:"100%",
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai height:"90%",
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai verbose : false,
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai printTimeout: 0,
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai newestOnTop : false,
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai entryTemplate: '<pre class="{entry_class} {cat_class} {src_class}">'+
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai '<span class="{entry_cat_class}">{label}</span>'+
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai '<span class="{entry_content_class}">{message}</span>'+
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai }).render();
98c1ab155c0e2148f69291b1abe1007c9d5a08e8Satyen Desai<p><input type="button" value="Run Tests" id="btnRun" disabled=true></p>