Skip to content

Commit

Permalink
Added new integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
mstniy committed May 2, 2024
1 parent 1ae6b29 commit 21bcaae
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions integration/test/ParseObjectTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,18 @@ describe('Parse Object', () => {
assert.strictEqual(result.get('a').b.c.d, 2);
});

it('can set nested fields without repeating pending operations on toJSON (regression test for #1452)', async () => {
const a = new Parse.Object('MyObject');
a.set('obj', {});
await a.save();
a.set('obj.a', 0);
const json = a.toJSON();
expect(json.obj).toEqual({ a: 0 });
expect(new Set(Object.keys(json))).toEqual(
new Set(['objectId', 'createdAt', 'updatedAt', 'obj'])
);
});

it('can increment nested field and retain full object', async () => {
const obj = new Parse.Object('TestIncrementObject');
obj.set('objectField', { number: 5, letter: 'a' });
Expand Down

0 comments on commit 21bcaae

Please sign in to comment.