Neues Initialrelease mit IonicMaterial

This commit is contained in:
Carsten Hilmer
2016-08-22 12:55:52 +02:00
parent 30a5df79aa
commit 45e482b14d
1249 changed files with 305225 additions and 68794 deletions

View File

@@ -0,0 +1,140 @@
describe('ngCordovaMocks', function() {
beforeEach(function() {
module('ngCordovaMocks');
});
describe('cordovaSocialSharing', function () {
var $rootScope = null;
var $cordovaSocialSharing = null;
beforeEach(inject(function (_$cordovaSocialSharing_, _$rootScope_) {
$cordovaSocialSharing = _$cordovaSocialSharing_;
$rootScope = _$rootScope_;
}));
it('should share with twitter', function (done) {
$cordovaSocialSharing.shareViaTwitter('Check out Ecofic!', null, 'http://www.ecofic.com')
.then(
function() { expect(true).toBe(true); },
function() { expect(false).toBe(true); }
)
.finally(function() { done(); })
;
$rootScope.$digest();
});
it('should throw an error while sharing with twitter.', function(done) {
$cordovaSocialSharing.throwsError = true;
$cordovaSocialSharing.shareViaTwitter('Check out Ecofic!', null, 'http://www.ecofic.com')
.then(
function() { expect(true).toBe(false); },
function() { expect(true).toBe(true); }
)
.finally(function() { done(); })
;
$rootScope.$digest();
});
it('should share with whatsApp', function (done) {
$cordovaSocialSharing.shareViaWhatsApp('Check out Ecofic!', null, 'http://www.ecofic.com')
.then(
function() { expect(true).toBe(true); },
function() { expect(false).toBe(true); }
)
.finally(function() { done(); })
;
$rootScope.$digest();
});
it('should throw an error while sharing with whatsApp.', function(done) {
$cordovaSocialSharing.throwsError = true;
$cordovaSocialSharing.shareViaWhatsApp('Check out Ecofic!', null, 'http://www.ecofic.com')
.then(
function() { expect(true).toBe(false); },
function() { expect(true).toBe(true); }
)
.finally(function() { done(); })
;
$rootScope.$digest();
});
it('should share with facebook', function (done) {
$cordovaSocialSharing.shareViaFacebook('Check out Ecofic!', null, 'http://www.ecofic.com')
.then(
function() { expect(true).toBe(true); },
function() { expect(false).toBe(true); }
)
.finally(function() { done(); })
;
$rootScope.$digest();
});
it('should throw an error while sharing with facebook.', function(done) {
$cordovaSocialSharing.throwsError = true;
$cordovaSocialSharing.shareViaFacebook('Check out Ecofic!', null, 'http://www.ecofic.com')
.then(
function() { expect(true).toBe(false); },
function() { expect(true).toBe(true); }
)
.finally(function() { done(); })
;
$rootScope.$digest();
});
it('should share via sms', function (done) {
$cordovaSocialSharing.shareViaSMS('Check out Ecofic!', '1-555-555-5555')
.then(
function() { expect(true).toBe(true); },
function() { expect(false).toBe(true); }
)
.finally(function() { done(); })
;
$rootScope.$digest();
});
it('should throw an error while sharing via sms.', function(done) {
$cordovaSocialSharing.throwsError = true;
$cordovaSocialSharing.shareViaSMS('Check out Ecofic!', '1-555-555-5555')
.then(
function() { expect(true).toBe(false); },
function() { expect(true).toBe(true); }
)
.finally(function() { done(); })
;
$rootScope.$digest();
});
it('should share via email', function (done) {
$cordovaSocialSharing.shareViaEmail('This is an email message', 'Email Subject', [], [], [])
.then(
function() { expect(true).toBe(true); },
function() { expect(false).toBe(true); }
)
.finally(function() { done(); })
;
$rootScope.$digest();
});
it('should throw an error while sharing via email.', function(done) {
$cordovaSocialSharing.throwsError = true;
$cordovaSocialSharing.shareViaEmail('This is an email message', 'Email Subject', [], [], [])
.then(
function() { expect(true).toBe(false); },
function() { expect(true).toBe(true); }
)
.finally(function() { done(); })
;
$rootScope.$digest();
});
});
})