Full query support for badge Increment

This commit is contained in:
Florent Vilmart
2016-03-11 16:23:58 -05:00
parent 7d787328c5
commit b89619b6ee
3 changed files with 70 additions and 12 deletions

View File

@@ -1,3 +1,4 @@
"use strict";
var PushController = require('../src/Controllers/PushController').PushController;
var Config = require('../src/Config');
@@ -220,5 +221,45 @@ describe('PushController', () => {
});
});
it('should support full RESTQuery for increment', (done) => {
var payload = {data: {
alert: "Hello World!",
badge: 'Increment',
}}
var pushAdapter = {
send: function(body, installations) {
return Promise.resolve();
},
getValidPushTypes: function() {
return ["ios"];
}
}
var config = new Config(Parse.applicationId);
var auth = {
isMaster: true
}
let where = {
'deviceToken': {
'$inQuery': {
'where': {
'deviceType': 'ios'
},
className: '_Installation'
}
}
}
var pushController = new PushController(pushAdapter, Parse.applicationId);
pushController.sendPush(payload, where, config, auth).then((result) => {
done();
}).catch((err) => {
fail('should not fail');
done();
});
});
});