Skip to content

Commit af1cc04

Browse files
committed
Update ParseQueryTest.js
1 parent d9648f3 commit af1cc04

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

integration/test/ParseQueryTest.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,22 +1774,22 @@ describe('Parse Query', () => {
17741774
}
17751775
});
17761776

1777-
it('can include User fields', done => {
1778-
Parse.User.signUp('bob', 'password', { age: 21 })
1779-
.then(user => {
1780-
const obj = new TestObject();
1781-
return obj.save({ owner: user });
1782-
})
1783-
.then(obj => {
1784-
const query = new Parse.Query(TestObject);
1785-
query.include('owner');
1786-
return query.get(obj.id);
1787-
})
1788-
.then(objAgain => {
1789-
assert(objAgain.get('owner') instanceof Parse.User);
1790-
assert.equal(objAgain.get('owner').get('age'), 21);
1791-
done();
1792-
});
1777+
it('can include User fields', async () => {
1778+
const user = new Parse.User();
1779+
user.set('username', 'bob');
1780+
user.set('password', 'password');
1781+
user.set('age', 21);
1782+
const acl = new Parse.ACL();
1783+
acl.setPublicReadAccess(true);
1784+
user.setACL(acl);
1785+
await user.signUp();
1786+
const obj = new TestObject();
1787+
await obj.save({ owner: user });
1788+
const query = new Parse.Query(TestObject);
1789+
query.include('owner');
1790+
const objAgain = await query.get(obj.id);
1791+
assert(objAgain.get('owner') instanceof Parse.User);
1792+
assert.equal(objAgain.get('owner').get('age'), 21);
17931793
});
17941794

17951795
it('can build OR queries', done => {

0 commit comments

Comments
 (0)