JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://yui.yahooapis.com/3.5.0pr1/build/yui/yui-min.js"></script>
<div id="console" class="yui3-skin-sam"></div>
JavaScript
YUI().use('app-base', 'test', 'test-console', function (Y) {
var suite = new Y.Test.Suite('App showView() callback');
suite.add(new Y.Test.Case({
name: 'App showView() callback',
'showView() should call the specified callback when the views are different': function () {
var app = new Y.App(),
count = 0;
app.showView(new Y.View(), null, function () {
count += 5;
});
app.showView(new Y.View(), null, function () {
count += 1;
});
Y.Assert.areSame(2, count);
},
'showView() should call the specified callback when the views are different': function () {
var app = new Y.App(),
view = new Y.View(),
count = 0;
app.showView(view, null, function () {
count += 5;
});
app.showView(view, null, function () {
count += 1;
});
Y.Assert.areSame(2, count);
}
}));
new Y.Test.Console().render('#console');
Y.Test.Runner.add(suite);
Y.Test.Runner.run();
});