@@ -206,23 +206,24 @@ describe('Parse.File testing', () => {
206
206
notEqual ( file . name ( ) , 'hello.txt' ) ;
207
207
} ) ;
208
208
209
- it ( 'save file with tags' , async ( ) => {
209
+ it ( 'saves the file with tags' , async ( ) => {
210
210
spyOn ( FilesController . prototype , 'createFile' ) . and . callThrough ( ) ;
211
211
const file = new Parse . File ( 'hello.txt' , data , 'text/plain' ) ;
212
- file . setTags ( { hello : 'world' } ) ;
213
- ok ( ! file . url ( ) ) ;
212
+ const tags = { hello : 'world' } ;
213
+ file . setTags ( tags ) ;
214
+ expect ( file . url ( ) ) . toBeUndefined ( ) ;
214
215
const result = await file . save ( ) ;
215
- equal ( result . tags ( ) , { hello : 'world' } ) ;
216
+ expect ( result . tags ( ) ) . toEqual ( tags ) ;
216
217
expect ( FilesController . prototype . createFile . calls . argsFor ( 0 ) [ 4 ] ) . toEqual ( {
217
- tags : { hello : 'world' } ,
218
+ tags : tags ,
218
219
metadata : { } ,
219
220
} ) ;
220
221
} ) ;
221
222
222
- it ( 'empty file tags should not be passed while saving' , async ( ) => {
223
+ it ( 'does not pass empty file tags while saving' , async ( ) => {
223
224
spyOn ( FilesController . prototype , 'createFile' ) . and . callThrough ( ) ;
224
225
const file = new Parse . File ( 'hello.txt' , data , 'text/plain' ) ;
225
- ok ( ! file . url ( ) ) ;
226
+ expect ( file . url ( ) ) . toBeUndefined ( ) ;
226
227
await file . save ( ) ;
227
228
expect ( FilesController . prototype . createFile . calls . argsFor ( 0 ) [ 4 ] ) . toEqual ( {
228
229
metadata : { } ,
0 commit comments