1
1
'use strict' ;
2
2
3
3
const assert = require ( 'assert' ) ;
4
- const clear = require ( './clear' ) ;
5
4
const Parse = require ( '../../node' ) ;
6
5
7
- const TestObject = Parse . Object . extend ( 'TestObject' ) ;
8
-
9
6
describe ( 'Parse.ACL' , ( ) => {
10
- beforeEach ( done => {
11
- Parse . initialize ( 'integration' ) ;
12
- Parse . CoreManager . set ( 'SERVER_URL' , 'http://localhost:1337/parse' ) ;
13
- Parse . Storage . _clear ( ) ;
7
+ beforeEach ( ( ) => {
14
8
Parse . User . enableUnsafeCurrentUser ( ) ;
15
- clear ( )
16
- . then ( ( ) => {
17
- Parse . User . logOut ( ) . then (
18
- ( ) => {
19
- done ( ) ;
20
- } ,
21
- ( ) => {
22
- done ( ) ;
23
- }
24
- ) ;
25
- } )
26
- . catch ( done . fail ) ;
27
9
} ) ;
28
10
29
11
it ( 'acl must be valid' , ( ) => {
@@ -61,7 +43,7 @@ describe('Parse.ACL', () => {
61
43
assert . equal ( object . getACL ( ) . getPublicReadAccess ( ) , false ) ;
62
44
assert . equal ( object . getACL ( ) . getPublicWriteAccess ( ) , false ) ;
63
45
64
- await await Parse . User . logOut ( ) ;
46
+ await Parse . User . logOut ( ) ;
65
47
try {
66
48
const query = new Parse . Query ( TestObject ) ;
67
49
await query . get ( object . id ) ;
@@ -214,7 +196,7 @@ describe('Parse.ACL', () => {
214
196
object . getACL ( ) . setPublicReadAccess ( true ) ;
215
197
await object . save ( ) ;
216
198
217
- Parse . User . logOut ( ) ;
199
+ await Parse . User . logOut ( ) ;
218
200
const o = await new Parse . Query ( TestObject ) . get ( object . id ) ;
219
201
assert ( o ) ;
220
202
} ) ;
@@ -232,7 +214,7 @@ describe('Parse.ACL', () => {
232
214
object . getACL ( ) . setPublicReadAccess ( true ) ;
233
215
await object . save ( ) ;
234
216
235
- Parse . User . logOut ( ) ;
217
+ await Parse . User . logOut ( ) ;
236
218
const o = await new Parse . Query ( 'AlsoUniqueObject' ) . find ( ) ;
237
219
238
220
assert ( o . length > 0 ) ;
@@ -251,7 +233,7 @@ describe('Parse.ACL', () => {
251
233
object . getACL ( ) . setPublicReadAccess ( true ) ;
252
234
await object . save ( ) ;
253
235
254
- Parse . User . logOut ( ) ;
236
+ await Parse . User . logOut ( ) ;
255
237
object . set ( 'score' , 10 ) ;
256
238
try {
257
239
await object . save ( ) ;
@@ -273,7 +255,7 @@ describe('Parse.ACL', () => {
273
255
object . getACL ( ) . setPublicReadAccess ( true ) ;
274
256
await object . save ( ) ;
275
257
276
- Parse . User . logOut ( ) ;
258
+ await Parse . User . logOut ( ) ;
277
259
try {
278
260
await object . destroy ( ) ;
279
261
} catch ( e ) {
0 commit comments