Skip to content

Commit de77af6

Browse files
committed
No test for exception on non-sensical parent
1 parent a0488b3 commit de77af6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/__tests__/ParseObject-test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,20 @@ describe('ParseObject', () => {
642642

643643
});
644644

645+
it('throw exception on non-sensical parent (not set)', async () => {
646+
const o = new ParseObject('Person');
647+
o.increment('data', 2);
648+
expect(Object.keys(o._getPendingOps()[0]).length).toBe(1);
649+
650+
try {
651+
o.set('data.a', 3);
652+
expect(true).toBe(false);
653+
} catch (e) {
654+
expect(e.message).toBe('Trying to set sub property on a invalid property (data -> a)');
655+
}
656+
657+
});
658+
645659
it('can clear all fields', () => {
646660
const o = new ParseObject('Person');
647661
o._finishFetch({

0 commit comments

Comments
 (0)