@@ -8,7 +8,6 @@ describe('UploadPicker rendering', () => {
88 cy . mount ( UploadPicker )
99 cy . get ( 'form' ) . should ( 'have.class' , 'upload-picker' )
1010 cy . get ( 'form input[type="file"]' ) . should ( 'exist' )
11- cy . screenshot ( )
1211 } )
1312} )
1413
@@ -35,7 +34,7 @@ describe('NewFileMenu handling', () => {
3534 displayName : 'Create empty file' ,
3635 templateName : 'New file' ,
3736 iconClass : 'icon-file' ,
38- if : fileInfo => fileInfo . permissions . includes ( 'CK' ) ,
37+ if : ( fileInfo ) => fileInfo . permissions . includes ( 'CK' ) ,
3938 handler ( ) { } ,
4039 }
4140
@@ -51,19 +50,18 @@ describe('NewFileMenu handling', () => {
5150 // Check and init aliases
5251 cy . get ( 'form input[type="file"]' ) . as ( 'input' ) . should ( 'exist' )
5352 cy . get ( 'form .upload-picker__progress' ) . as ( 'progress' ) . should ( 'exist' )
54- cy . get ( 'form .action-item__menutoggle' ) . as ( 'menuButton' ) . should ( 'exist' )
53+ cy . get ( 'form .action-item__menutoggle' )
54+ . as ( 'menuButton' )
55+ . should ( 'exist' )
5556
5657 cy . get ( '@menuButton' ) . click ( )
5758 cy . get ( '[data-upload-picker-add]' ) . should ( 'have.length' , 1 )
5859 cy . get ( '.upload-picker__menu-entry' ) . should ( 'have.length' , 1 )
5960
60- cy . screenshot ( )
61-
6261 cy . get ( '.upload-picker__menu-entry' )
6362 . click ( )
6463 . then ( ( ) => {
6564 expect ( entry . handler ) . to . be . called
66- cy . screenshot ( )
6765 } )
6866 } )
6967
@@ -74,25 +72,29 @@ describe('NewFileMenu handling', () => {
7472 // Check and init aliases
7573 cy . get ( 'form input[type="file"]' ) . as ( 'input' ) . should ( 'exist' )
7674 cy . get ( 'form .upload-picker__progress' ) . as ( 'progress' ) . should ( 'exist' )
77- cy . get ( 'form .action-item__menutoggle' ) . as ( 'menuButton' ) . should ( 'exist' )
75+ cy . get ( 'form .action-item__menutoggle' )
76+ . as ( 'menuButton' )
77+ . should ( 'exist' )
7878
7979 cy . get ( '@menuButton' ) . click ( )
8080 cy . get ( '[data-upload-picker-add]' ) . should ( 'have.length' , 1 )
8181 cy . get ( '.upload-picker__menu-entry' ) . should ( 'have.length' , 1 )
82- cy . screenshot ( )
8382
8483 // Close menu
8584 cy . get ( 'body' ) . click ( )
86- cy . get ( '[data-upload-picker-add]' ) . should ( 'not.exist ' )
87- cy . get ( '.upload-picker__menu-entry' ) . should ( 'not.exist ' )
85+ cy . get ( '[data-upload-picker-add]' ) . should ( 'not.be.visible ' )
86+ cy . get ( '.upload-picker__menu-entry' ) . should ( 'not.be.visible ' )
8887
89- cy . get ( '@component' ) . then ( component => {
90- component . setContext ( Object . assign ( { } , propsData . context , { permissions : 'GR' } ) )
88+ cy . get ( '@component' ) . then ( ( component ) => {
89+ component . setContext (
90+ Object . assign ( { } , propsData . context , { permissions : 'GR' } )
91+ )
9192 } )
92- cy . get ( 'form .action-item__menutoggle' ) . as ( 'menuButton' ) . should ( 'not.exist' )
93+ cy . get ( 'form .action-item__menutoggle' )
94+ . as ( 'menuButton' )
95+ . should ( 'not.exist' )
9396 cy . get ( '[data-upload-picker-add]' ) . should ( 'have.length' , 1 )
9497 cy . get ( '.upload-picker__menu-entry' ) . should ( 'not.exist' )
95- cy . screenshot ( )
9698 } )
9799} )
98100
@@ -119,15 +121,15 @@ describe('UploadPicker valid uploads', () => {
119121 cy . intercept ( {
120122 method : 'PUT' ,
121123 url : '/remote.php/dav/uploads/*/web-file-upload*/*' ,
122- } , req => {
124+ } , ( req ) => {
123125 chunksRequestsSpy ( )
124126 req . reply ( {
125127 statusCode : 201 ,
126128 } )
127129 } ) . as ( 'chunks' )
128130
129131 // Intercept final assembly request
130- cy . intercept ( 'MOVE' , '/remote.php/dav/uploads/*/web-file-upload*/.file' , req => {
132+ cy . intercept ( 'MOVE' , '/remote.php/dav/uploads/*/web-file-upload*/.file' , ( req ) => {
131133 req . reply ( {
132134 statusCode : 204 ,
133135 // Fake assembling chunks
@@ -146,15 +148,22 @@ describe('UploadPicker valid uploads', () => {
146148 } )
147149
148150 cy . wait ( '@init' ) . then ( ( ) => {
149- cy . get ( 'form .upload-picker__progress' ) . as ( 'progress' ) . should ( 'be.visible' )
151+ cy . get ( 'form .upload-picker__progress' )
152+ . as ( 'progress' )
153+ . should ( 'be.visible' )
150154 } )
151155 cy . wait ( '@chunks' ) . then ( ( ) => {
152- cy . get ( 'form .upload-picker__progress' ) . as ( 'progress' ) . should ( 'be.visible' )
153- cy . get ( '@progress' ) . children ( 'progress' ) . should ( 'not.have.value' , '0' )
154- cy . screenshot ( )
156+ cy . get ( 'form .upload-picker__progress' )
157+ . as ( 'progress' )
158+ . should ( 'be.visible' )
159+ cy . get ( '@progress' )
160+ . children ( 'progress' )
161+ . should ( 'not.have.value' , '0' )
155162 } )
156163 cy . wait ( '@assembly' , { timeout : 60000 } ) . then ( ( ) => {
157- cy . get ( 'form .upload-picker__progress' ) . as ( 'progress' ) . should ( 'not.be.visible' )
164+ cy . get ( 'form .upload-picker__progress' )
165+ . as ( 'progress' )
166+ . should ( 'not.be.visible' )
158167 expect ( chunksRequestsSpy ) . to . have . always . been . callCount ( 26 )
159168 } )
160169 } )
@@ -174,9 +183,13 @@ describe('UploadPicker valid uploads', () => {
174183 lastModified : new Date ( ) . getTime ( ) ,
175184 } )
176185
177- cy . get ( 'form .upload-picker__progress' ) . as ( 'progress' ) . should ( 'not.be.visible' )
186+ cy . get ( 'form .upload-picker__progress' )
187+ . as ( 'progress' )
188+ . should ( 'not.be.visible' )
178189 cy . wait ( '@upload' ) . then ( ( ) => {
179- cy . get ( '@progress' ) . children ( 'progress' ) . should ( 'not.have.value' , '0' )
190+ cy . get ( '@progress' )
191+ . children ( 'progress' )
192+ . should ( 'not.have.value' , '0' )
180193 } )
181194 } )
182195} )
@@ -209,10 +222,12 @@ describe('Destination management', () => {
209222 } )
210223
211224 cy . wait ( '@upload' ) . then ( ( upload ) => {
212- expect ( upload . request . url ) . to . have . string ( '/remote.php/dav/files/user/image.jpg' )
225+ expect ( upload . request . url ) . to . have . string (
226+ '/remote.php/dav/files/user/image.jpg'
227+ )
213228 } )
214229
215- cy . get ( '@component' ) . then ( component => {
230+ cy . get ( '@component' ) . then ( ( component ) => {
216231 component . setDestination ( '/Photos' )
217232 // Wait for prop propagation
218233 expect ( component . uploadManager . destination ) . to . equal ( '/Photos' )
@@ -228,7 +243,9 @@ describe('Destination management', () => {
228243 } )
229244
230245 cy . wait ( '@upload' ) . then ( ( upload ) => {
231- expect ( upload . request . url ) . to . have . string ( '/remote.php/dav/files/user/Photos/image.jpg' )
246+ expect ( upload . request . url ) . to . have . string (
247+ '/remote.php/dav/files/user/Photos/image.jpg'
248+ )
232249 } )
233250 } )
234251} )
@@ -262,14 +279,18 @@ describe('Root management', () => {
262279 } )
263280
264281 cy . wait ( '@upload' ) . then ( ( upload ) => {
265- expect ( upload . request . url ) . to . have . string ( '/remote.php/dav/files/user/image.jpg' )
282+ expect ( upload . request . url ) . to . have . string (
283+ '/remote.php/dav/files/user/image.jpg'
284+ )
266285 } )
267286
268- cy . get ( '@component' ) . then ( component => {
287+ cy . get ( '@component' ) . then ( ( component ) => {
269288 component . setRoot ( 'dav/photos/admin/albums' )
270289 component . setDestination ( '/2022 Summer Vacations' )
271290 // Wait for prop propagation
272- expect ( component . uploadManager . root ) . to . match ( / d a v \/ p h o t o s \/ a d m i n \/ a l b u m s $ / i)
291+ expect ( component . uploadManager . root ) . to . match (
292+ / d a v \/ p h o t o s \/ a d m i n \/ a l b u m s $ / i
293+ )
273294 } )
274295
275296 // Intercept single upload
@@ -287,7 +308,9 @@ describe('Root management', () => {
287308 } )
288309
289310 cy . wait ( '@upload' ) . then ( ( upload ) => {
290- expect ( upload . request . url ) . to . have . string ( '/remote.php/dav/photos/admin/albums/2022%20Summer%20Vacations/image.jpg' )
311+ expect ( upload . request . url ) . to . have . string (
312+ '/remote.php/dav/photos/admin/albums/2022%20Summer%20Vacations/image.jpg'
313+ )
291314 } )
292315 } )
293316} )
0 commit comments