Skip to content

fix: Incorrect Parse.Object field values with Parse JS SDK 5.2.0 #9174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions spec/ParseObject.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2055,4 +2055,33 @@ describe('Parse.Object testing', () => {
const object = new Parse.Object('CloudCodeIsNew');
await object.save();
});

fit('returns correct field values', async () => {
const values = [
{ field: 'string', value: 'string' },
{ field: 'number', value: 1 },
{ field: 'boolean', value: true },
{ field: 'array', value: [1, 2, 3] },
{ field: 'object1', value: { key: 'value' } },
{ field: 'object2', value: { key1: 'value1', key2: 'value2' } },
{ field: 'object3', value: { key1: 1, key2: 2 } },
{ field: 'object4', value: { '1': 1 } },
{ field: 'date', value: new Date() },
{ field: 'file', value: Parse.File.fromJSON({
__type: 'File',
name: 'name',
url: 'http://localhost:8378/1/files/test/name',
}) },
{ field: 'geoPoint', value: new Parse.GeoPoint(40, -30) },
{ field: 'bytes', value: { __type: 'Bytes', base64: 'ZnJveW8=' } },
];
for (const value of values) {
const object = new TestObject();
object.set(value.field, value.value);
await object.save();
const query = new Parse.Query(TestObject);
const objectAgain = await query.get(object.id);
expect(objectAgain.get(value.field)).toEqual(value.value);
}
});
});
Loading