Skip to content

Commit af7336e

Browse files
committed
test for repro #2005
1 parent 5feceaa commit af7336e

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

spec/schemas.spec.js

+28
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,34 @@ describe('schemas', () => {
15481548
});
15491549
});
15501550

1551+
it('can query with include and CLP (issue #2005)', (done) => {
1552+
setPermissionsOnClass('AnotherObject', {
1553+
get: {"*": true},
1554+
find: {},
1555+
create: {'*': true},
1556+
update: {'*': true},
1557+
delete: {'*': true},
1558+
addField:{'*': true}
1559+
}).then(() => {
1560+
let obj = new Parse.Object('AnObject');
1561+
let anotherObject = new Parse.Object('AnotherObject');
1562+
return obj.save({
1563+
anotherObject
1564+
})
1565+
}).then(() => {
1566+
let query = new Parse.Query('AnObject');
1567+
query.include('anotherObject');
1568+
return query.find();
1569+
}).then((res) => {
1570+
expect(res.length).toBe(1);
1571+
expect(res[0].get('anotherObject')).not.toBeUndefined();
1572+
done();
1573+
}).catch((err) => {
1574+
jfail(err);
1575+
done();
1576+
})
1577+
});
1578+
15511579
it('can add field as master (issue #1257)', (done) => {
15521580
setPermissionsOnClass('AClass', {
15531581
'addField': {}

0 commit comments

Comments
 (0)