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 575851c commit ae457ddCopy full SHA for ae457dd
src/__tests__/ParseObject-test.js
@@ -622,6 +622,20 @@ describe('ParseObject', () => {
622
expect(o._getPendingOps()[0]['data.b']._value).toStrictEqual({ c: 2 });
623
});
624
625
+ it('throw exception on non-sensical parent (not set)', async () => {
626
+ const o = new ParseObject('Person');
627
+ o.increment('data', 2);
628
+ expect(Object.keys(o._getPendingOps()[0]).length).toBe(1);
629
+
630
+ try {
631
+ o.set('data.a', 3);
632
+ expect(true).toBe(false);
633
+ } catch (e) {
634
+ expect(e.message).toBe('Trying to set sub property on a invalid property (data -> a)');
635
+ }
636
637
+ });
638
639
it('can clear all fields', () => {
640
const o = new ParseObject('Person');
641
o._finishFetch({
0 commit comments