We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 823f2d9 commit 8a058bcCopy full SHA for 8a058bc
src/__tests__/ParseObject-test.js
@@ -628,6 +628,20 @@ describe('ParseObject', () => {
628
expect(o._getPendingOps()[0]['data.b']._value).toStrictEqual({ c: 2 });
629
});
630
631
+ it('throw exception on non-sensical parent (not set)', async () => {
632
+ const o = new ParseObject('Person');
633
+ o.increment('data', 2);
634
+ expect(Object.keys(o._getPendingOps()[0]).length).toBe(1);
635
+
636
+ try {
637
+ o.set('data.a', 3);
638
+ expect(true).toBe(false);
639
+ } catch (e) {
640
+ expect(e.message).toBe('Trying to set sub property on a invalid property (data -> a)');
641
+ }
642
643
+ });
644
645
it('can clear all fields', () => {
646
const o = new ParseObject('Person');
647
o._finishFetch({
0 commit comments