@@ -820,26 +820,9 @@ describe('Attributes update', () => {
820820 } )
821821
822822 expect ( file . attributes ?. etag ) . toBe ( '5678' )
823- expect ( file . attributes ?. size ) . toBe ( 9999 )
824- expect ( file . attributes ?. owner ) . toBe ( 'emma' )
825- expect ( file . attributes ?. fileid ) . toBeUndefined ( )
826- } )
827-
828- test ( 'Deprecated access to toplevel attributes' , ( ) => {
829- const spy = vi . spyOn ( window . console , 'warn' )
830- const file = new File ( {
831- source : 'https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg' ,
832- mime : 'image/jpeg' ,
833- owner : 'emma' ,
834- size : 9999 ,
835- attributes : {
836- etag : '1234' ,
837- size : 9999 ,
838- } ,
839- } )
840-
841- expect ( file . attributes . size ) . toBe ( 9999 )
842- expect ( spy ) . toBeCalledTimes ( 1 )
823+ expect ( file ?. size ) . toBe ( 9999 )
824+ expect ( file ?. owner ) . toBe ( 'emma' )
825+ expect ( file ?. fileid ) . toBeUndefined ( )
843826 } )
844827
845828 test ( 'Changing a protected attributes is not possible' , ( ) => {
@@ -853,9 +836,10 @@ describe('Attributes update', () => {
853836 } )
854837
855838 // We can not update the owner
856- expect ( ( ) => { file . attributes . owner = 'admin' } ) . toThrowError ( )
839+ // @ts -expect-error owner is a read-only property
840+ expect ( ( ) => { file . owner = 'admin' } ) . toThrowError ( )
857841 // The owner is still the original one
858- expect ( file . attributes ?. owner ) . toBe ( 'emma' )
842+ expect ( file ?. owner ) . toBe ( 'emma' )
859843 } )
860844
861845} )
0 commit comments