Refactor pushStatusHandler to use Parse instead of direct access (#4173)

* Refactors pushStatusHandler to use HTTP interface so we can bind CloudCode hooks

* Handle correctly nested dot atomic operations

* Better handling of restricted class names, add support for afterSave _PushStatus

* Adds simple testing for afterSave(PushStatus)

* Reverts jobStatusHandler

* Addresses fixes

* adds delays to all methods
This commit is contained in:
Florent Vilmart
2017-09-18 15:01:07 -04:00
committed by GitHub
parent a39d045c7d
commit a5ce9fc175
9 changed files with 161 additions and 58 deletions

View File

@@ -1627,4 +1627,19 @@ describe('afterFind hooks', () => {
})
.then(() => done());
});
it('should validate triggers correctly', () => {
expect(() => {
Parse.Cloud.beforeSave('_Session', () => {});
}).toThrow('Triggers are not supported for _Session class.');
expect(() => {
Parse.Cloud.afterSave('_Session', () => {});
}).toThrow('Triggers are not supported for _Session class.');
expect(() => {
Parse.Cloud.beforeSave('_PushStatus', () => {});
}).toThrow('Only afterSave is allowed on _PushStatus');
expect(() => {
Parse.Cloud.afterSave('_PushStatus', () => {});
}).not.toThrow();
});
});