Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

added result to success callback in socialSharing plugin #1400

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/mocks/socialSharing.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ ngCordovaMocks.factory('$cordovaSocialSharing', ['$q', function ($q) {
this.attachments = file;
this.link = link;

defer.resolve();
defer.resolve({
completed:true
});
}
return defer.promise;
},
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/socialSharing.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ angular.module('ngCordova.plugins.socialSharing', [])
subject = subject || null;
file = file || null;
link = link || null;
$window.plugins.socialsharing.share(message, subject, file, link, function () {
q.resolve(true);
$window.plugins.socialsharing.share(message, subject, file, link, function (result) {
q.resolve(result);
}, function () {
q.reject(false);
});
Expand Down
8 changes: 4 additions & 4 deletions test/mocks/socialSharing.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('ngCordovaMocks', function() {
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(true).toBeTruthy(); },
function() { expect(false).toBe(true); }
)
.finally(function() { done(); })
Expand All @@ -35,7 +35,7 @@ describe('ngCordovaMocks', function() {
;

$rootScope.$digest();
});
});

it('should share with whatsApp', function (done) {
$cordovaSocialSharing.shareViaWhatsApp('Check out Ecofic!', null, 'http://www.ecofic.com')
Expand Down Expand Up @@ -135,6 +135,6 @@ describe('ngCordovaMocks', function() {
;

$rootScope.$digest();
});
});
});
})
})