Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
fixed more functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drewfish committed May 7, 2013
1 parent 70ba1d1 commit 90505de
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 33 deletions.
43 changes: 18 additions & 25 deletions tests/func/usecases/testpreattachedbinder.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
/*
* This is a basic func test for a UseCase application.
*/
YUI({
useConsoleOutput: true,
useBrowserConsole: true,
logInclude: { TestRunner: true }
}).use('node', 'node-event-simulate', 'test', 'console', 'intl', 'datatype-date-format', function (Y) {

var suite = new Y.Test.Suite("UseCases: preattachedbinder");
YUI.add('usecases_testpreattachedbinder', function (Y) {
var suite = new Y.Test.Suite("UseCases: preattachedbinder");

suite.add(new Y.Test.Case({
"test preattachedbinder": function() {
var that = this;
Y.Assert.areEqual('Enjoy your Flickr Images!',Y.one('h2').get('innerHTML').match(/Enjoy your Flickr Images!/gi));
Y.Assert.areEqual('\"This is the config for config1 in application.json\"', Y.one('#myconfig').get('innerHTML'));
Y.one('#paginate a').simulate('click');
that.wait(function(){
Y.Assert.areEqual('Hallo!',Y.one('h2').get('innerHTML').match(/Hallo!/gi));
Y.Assert.areEqual('\"mynewconfig\"', Y.one('#myconfig').get('innerHTML'));
}, 2000);
}

}));
suite.add(new Y.Test.Case({
"test preattachedbinder": function() {
var that = this;
Y.Assert.areEqual('Enjoy your Flickr Images!',Y.one('h2').get('innerHTML').match(/Enjoy your Flickr Images!/gi));
Y.Assert.areEqual('\"This is the config for config1 in application.json\"', Y.one('#myconfig').get('innerHTML'));
Y.one('#paginate a').simulate('click');
that.wait(function(){
Y.Assert.areEqual('Hallo!',Y.one('h2').get('innerHTML').match(/Hallo!/gi));
Y.Assert.areEqual('\"mynewconfig\"', Y.one('#myconfig').get('innerHTML'));
}, 2000);
}
}));

Y.Test.Runner.add(suite);
});
Y.Test.Runner.add(suite);
}, '0.0.1', {requires: [
'node', 'node-event-simulate', 'test', 'console', 'intl', 'datatype-date-format'
]});
14 changes: 6 additions & 8 deletions tests/func/usecases/testpreinit.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
/*
* This is a basic func test for a UseCase application.
*/
YUI({
useConsoleOutput: true,
useBrowserConsole: true,
logInclude: { TestRunner: true }
}).use('node', 'node-event-simulate', 'test', 'console', 'intl', 'datatype-date-format', function (Y) {

YUI.add('usecase_testpreinit', function (Y) {

var suite = new Y.Test.Suite("UseCases: preinit");

suite.add(new Y.Test.Case({
Expand All @@ -23,9 +19,11 @@ YUI({
Y.Assert.areEqual('Hallo!',Y.one('h2').get('innerHTML').match(/Hallo!/gi));
Y.Assert.areEqual('zur',Y.one('#paginate a').get('innerHTML').match(/zur/gi));
Y.Assert.areEqual('weiter',Y.all('#paginate a').item(1).get('innerHTML').match(/weiter/gi));
}, 2000);
}, 2000);
}
}));

Y.Test.Runner.add(suite);
});
}, '0.0.1', {requires: [
'node', 'node-event-simulate', 'test', 'console', 'intl', 'datatype-date-format'
]});

0 comments on commit 90505de

Please sign in to comment.