@@ -7,98 +7,88 @@ import { randUser } from '../utils/index.js'
77
88const user = randUser ( )
99
10- describe ( 'Text PROPFIND extension ' , function ( ) {
11- const PROPERTY_WORKSPACE = '{http://nextcloud.org/ns}rich-workspace'
12- const PROPERTY_WORKSPACE_FILE = '{http://nextcloud.org/ns}rich-workspace-file'
13- const PROPERTY_WORKSPACE_FLAT = '{http://nextcloud.org/ns}rich-workspace-flat'
14- const PROPERTY_WORKSPACE_FILE_FLAT = '{http://nextcloud.org/ns}rich-workspace-file-flat'
10+ // Retries fail because folders / files already exist.
11+ describe ( 'Text PROPFIND extension ' , { retries : 0 } , function ( ) {
12+ const PROPERTY_WORKSPACE = 'nc:rich-workspace'
13+ const PROPERTY_WORKSPACE_FILE = 'nc:rich-workspace-file'
14+ const PROPERTY_WORKSPACE_FLAT = 'nc:rich-workspace-flat'
15+ const PROPERTY_WORKSPACE_FILE_FLAT = 'nc:rich-workspace-file-flat'
1516
16- before ( function ( ) {
17+ before ( function ( ) {
1718 cy . createUser ( user )
1819 } )
1920
20- beforeEach ( function ( ) {
21+ beforeEach ( function ( ) {
2122 cy . login ( user )
2223 } )
2324
24- describe ( 'with workspaces enabled' , function ( ) {
25-
26- beforeEach ( function ( ) {
25+ describe ( 'with workspaces enabled' , function ( ) {
26+ beforeEach ( function ( ) {
2727 cy . configureText ( 'workspace_enabled' , 1 )
2828 } )
2929
30- it ( 'always adds rich workspace property' , function ( ) {
31- const properties = [ PROPERTY_WORKSPACE_FLAT , PROPERTY_WORKSPACE_FILE_FLAT ]
30+ it ( 'always adds rich workspace property' , function ( ) {
3231 cy . uploadFile ( 'empty.md' , 'text/markdown' , '/Readme.md' )
33- // FIXME: Ideally we do not need a page context for those tests at all
34- // For now the dashboard avoids that we have failing requests due to conflicts when updating the file
3532 cy . visit ( '/apps/dashboard' )
36- cy . propfindFolder ( '/' , 0 , properties )
33+ cy . propfindFolder ( '/' , 0 )
3734 . should ( 'have.property' , PROPERTY_WORKSPACE_FLAT , '' )
3835 cy . uploadFile ( 'test.md' , 'text/markdown' , '/Readme.md' )
39- cy . propfindFolder ( '/' , 0 , properties )
36+ cy . propfindFolder ( '/' , 0 )
4037 . should ( 'have.property' , PROPERTY_WORKSPACE_FLAT , '## Hello world\n' )
4138 cy . deleteFile ( '/Readme.md' )
42- cy . propfindFolder ( '/' , 0 , properties )
39+ cy . propfindFolder ( '/' , 0 )
4340 . should ( 'have.property' , PROPERTY_WORKSPACE_FLAT , '' )
4441 } )
4542
46- it ( 'never adds rich workspace property to nested folders for flat properties' , function ( ) {
43+ it ( 'never adds rich workspace property to nested folders for flat properties' , function ( ) {
4744 const properties = [ PROPERTY_WORKSPACE_FLAT , PROPERTY_WORKSPACE_FILE_FLAT ]
48- // FIXME: Ideally we do not need a page context for those tests at all
49- // For now the dashboard avoids that we have failing requests due to conflicts when updating the file
5045 cy . visit ( '/apps/dashboard' )
5146 cy . createFolder ( '/workspace-flat' )
52- cy . propfindFolder ( '/' , 1 , properties )
53- . then ( results => results . pop ( ) . propStat [ 0 ] . properties )
47+ cy . propfindFolder ( '/' , 1 )
48+ . then ( ( results ) => results . pop ( ) . propStat [ 0 ] . properties )
5449 . should ( 'have.property' , PROPERTY_WORKSPACE_FLAT , '' )
5550 cy . uploadFile ( 'test.md' , 'text/markdown' , '/workspace-flat/Readme.md' )
56- cy . propfindFolder ( '/' , 1 , properties )
57- . then ( results => results . pop ( ) . propStat [ 0 ] . properties )
51+ cy . propfindFolder ( '/' , 1 )
52+ . then ( ( results ) => results . pop ( ) . propStat [ 0 ] . properties )
5853 . should ( 'not.have.property' , PROPERTY_WORKSPACE_FLAT )
5954 cy . deleteFile ( '/workspace-flat/Readme.md' )
60- cy . propfindFolder ( '/' , 1 , properties )
61- . then ( results => results . pop ( ) . propStat [ 0 ] . properties )
55+ cy . propfindFolder ( '/' , 1 )
56+ . then ( ( results ) => results . pop ( ) . propStat [ 0 ] . properties )
6257 . should ( 'have.property' , PROPERTY_WORKSPACE_FLAT , '' )
6358 } )
6459
6560 // Android app relies on this to detect rich workspace availability in subfolders properly
66- it ( 'adds rich workspace property to nested folders for the default properties' , function ( ) {
67- const properties = [ PROPERTY_WORKSPACE , PROPERTY_WORKSPACE_FILE ]
61+ it ( 'adds rich workspace property to nested folders for the default properties' , function ( ) {
6862 cy . createFolder ( '/workspace' )
69- // FIXME: Ideally we do not need a page context for those tests at all
70- // For now the dashboard avoids that we have failing requests due to conflicts when updating the file
7163 cy . visit ( '/apps/dashboard' )
72- cy . propfindFolder ( '/' , 1 , properties )
73- . then ( results => results . pop ( ) . propStat [ 0 ] . properties )
64+ cy . propfindFolder ( '/' , 1 )
65+ . then ( ( results ) => results . pop ( ) . propStat [ 0 ] . properties )
7466 . should ( 'have.property' , PROPERTY_WORKSPACE , '' )
7567 cy . uploadFile ( 'test.md' , 'text/markdown' , '/workspace/Readme.md' )
76- cy . propfindFolder ( '/' , 1 , properties )
77- . then ( results => results . pop ( ) . propStat [ 0 ] . properties )
78- . should ( 'not .property' , PROPERTY_WORKSPACE , 'Hello world\n' )
68+ cy . propfindFolder ( '/' , 1 )
69+ . then ( ( results ) => results . pop ( ) . propStat [ 0 ] . properties )
70+ . should ( 'have .property' , PROPERTY_WORKSPACE , '## Hello world\n' )
7971 } )
8072 } )
8173
82- describe ( 'with workspaces disabled' , function ( ) {
83-
84- beforeEach ( function ( ) {
74+ describe ( 'with workspaces disabled' , function ( ) {
75+ beforeEach ( function ( ) {
8576 cy . configureText ( 'workspace_enabled' , 0 )
8677 } )
8778
88- it ( 'does not return a rich workspace property' , function ( ) {
79+ it ( 'does not return a rich workspace property' , function ( ) {
8980 // FIXME: Ideally we do not need a page context for those tests at all
9081 // For now the dashboard avoids that we have failing requests due to conflicts when updating the file
9182 cy . visit ( '/apps/dashboard' )
92- cy . propfindFolder ( '/' , 1 , [ PROPERTY_WORKSPACE_FLAT , PROPERTY_WORKSPACE_FILE_FLAT ] )
83+ cy . propfindFolder ( '/' , 1 )
9384 . should ( 'not.have.property' , PROPERTY_WORKSPACE_FLAT )
9485 cy . uploadFile ( 'test.md' , 'text/markdown' , '/Readme.md' )
95- cy . propfindFolder ( '/' , 1 , [ PROPERTY_WORKSPACE_FLAT , PROPERTY_WORKSPACE_FILE_FLAT ] )
86+ cy . propfindFolder ( '/' , 1 )
9687 . should ( 'not.have.property' , PROPERTY_WORKSPACE_FLAT )
9788 cy . createFolder ( '/without-workspace' )
9889 cy . propfindFolder ( '/' , 1 )
99- . then ( results => results . pop ( ) . propStat [ 0 ] . properties )
90+ . then ( ( results ) => results . pop ( ) . propStat [ 0 ] . properties )
10091 . should ( 'not.have.property' , PROPERTY_WORKSPACE_FLAT )
10192 } )
102-
10393 } )
104- } )
94+ } )
0 commit comments