Skip to content
This repository has been archived by the owner on Apr 16, 2019. It is now read-only.

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Maffett committed Jan 30, 2015
1 parent d002522 commit dbda222
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
8 changes: 4 additions & 4 deletions karma.conf.js
Expand Up @@ -7,7 +7,7 @@ module.exports = function (karma) {
frameworks: ['mocha'], frameworks: ['mocha'],
preprocessors: { preprocessors: {
'test/fixtures/*.html': ['html2js'], 'test/fixtures/*.html': ['html2js'],
'src/*.js': 'coverage', '**/src/*.js': 'coverage'
}, },


// list of files / patterns to load in the browser // list of files / patterns to load in the browser
Expand Down Expand Up @@ -42,7 +42,7 @@ module.exports = function (karma) {
//- cobertura (xml format supported by Jenkins) //- cobertura (xml format supported by Jenkins)
coverageReporter: { coverageReporter: {
// cf. http://gotwarlost.github.com/istanbul/public/apidocs/ // cf. http://gotwarlost.github.com/istanbul/public/apidocs/
type: 'lcov', type: 'html',
dir: 'coverage/' dir: 'coverage/'
}, },


Expand All @@ -65,7 +65,7 @@ module.exports = function (karma) {




// enable / disable watching file and executing tests whenever any file changes // enable / disable watching file and executing tests whenever any file changes
autoWatch: true, autoWatch: false,




// Start these browsers, currently available: // Start these browsers, currently available:
Expand All @@ -86,7 +86,7 @@ module.exports = function (karma) {


// Continuous Integration mode // Continuous Integration mode
// if true, it capture browsers, run tests and exit // if true, it capture browsers, run tests and exit
singleRun: false, singleRun: true,




plugins: [ plugins: [
Expand Down
7 changes: 6 additions & 1 deletion src/af.shim.js
Expand Up @@ -108,7 +108,7 @@
$.os.kindle=userAgent.match(/Silk-Accelerated/)?true:false; $.os.kindle=userAgent.match(/Silk-Accelerated/)?true:false;
//features //features
$.feat = {}; $.feat = {};
$.feat.cssPrefix = $.os.webkit ? "Webkit" : $.os.fennec ? "Moz" : $.os.ie ? "ms" : $.os.opera ? "O" : "";
$.feat.cssTransformStart = !$.os.opera ? "3d(" : "("; $.feat.cssTransformStart = !$.os.opera ? "3d(" : "(";
$.feat.cssTransformEnd = !$.os.opera ? ",0)" : ")"; $.feat.cssTransformEnd = !$.os.opera ? ",0)" : ")";
if ($.os.android && !$.os.webkit) if ($.os.android && !$.os.webkit)
Expand All @@ -123,6 +123,11 @@
$.os.ie=true; $.os.ie=true;
$.os.ieTouch=true; $.os.ieTouch=true;
} }
var items=["Webkit","Moz","ms","O"];
for(var j=0;j<items.length;j++){
if(document.documentElement.style[items[j]+"Transform"]==="")
$.feat.cssPrefix=items[j];
}


} }


Expand Down
14 changes: 8 additions & 6 deletions test/popup.test.js
Expand Up @@ -15,7 +15,7 @@ describe("popup",function(){
$("#popuptest").remove(); $("#popuptest").remove();
}); });



it("should display a popup and dismiss it",function(done){ it("should display a popup and dismiss it",function(done){


var msg="Hello 1"; var msg="Hello 1";
Expand Down Expand Up @@ -52,7 +52,7 @@ describe("popup",function(){
}); });
setTimeout(function(){ setTimeout(function(){
$('#myTestPopup').length.should.eql(1); $('#myTestPopup').length.should.eql(1);
$("#myTestPopup #action").trigger("click"); $("#myTestPopup #action").trigger("click");
setTimeout(function(){ setTimeout(function(){
$('#myTestPopup').length.should.eql(0); $('#myTestPopup').length.should.eql(0);
expect(what).to.be.true; expect(what).to.be.true;
Expand Down Expand Up @@ -84,7 +84,7 @@ describe("popup",function(){
}); });
setTimeout(function(){ setTimeout(function(){
$('#myTestPopup').length.should.eql(1); $('#myTestPopup').length.should.eql(1);
$("#myTestPopup #cancel").trigger("click"); $("#myTestPopup #cancel").trigger("click");
setTimeout(function(){ setTimeout(function(){
$('#myTestPopup').length.should.eql(0); $('#myTestPopup').length.should.eql(0);
expect(what).to.be.true; expect(what).to.be.true;
Expand Down Expand Up @@ -113,14 +113,15 @@ describe("popup",function(){


$.afui.ready(function(){ $.afui.ready(function(){
done(); done();
}); });
$.afui.launch(); $.afui.launch();


}); });

/// data directives /// data directives
/*
it("should display a data directive popup and dismiss it",function(done){ it("should display a data directive popup and dismiss it",function(done){
$("#popuptest a").trigger("click"); $("#popuptest a").trigger("click");
setTimeout(function(){ setTimeout(function(){
$('.afPopup').length.should.eql(1); $('.afPopup').length.should.eql(1);
Expand All @@ -132,4 +133,5 @@ describe("popup",function(){
},200); },200);
}); });
*/
}); });

0 comments on commit dbda222

Please sign in to comment.