-
Notifications
You must be signed in to change notification settings - Fork 127
Expand file tree
/
Copy pathpropfind.spec.js
More file actions
82 lines (68 loc) · 2.74 KB
/
Copy pathpropfind.spec.js
File metadata and controls
82 lines (68 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/**
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { randUser } from '../utils/index.js'
const user = randUser()
describe('Text PROPFIND extension ', function() {
const richWorkspace = '{http://nextcloud.org/ns}rich-workspace'
before(function() {
cy.createUser(user)
})
beforeEach(function() {
cy.login(user)
})
describe('with workspaces enabled', function() {
beforeEach(function() {
cy.configureText('workspace_enabled', 1)
})
// Android app relies on this to detect rich workspace availability
it('always adds rich workspace property', function() {
cy.uploadFile('empty.md', 'text/markdown', '/Readme.md')
// FIXME: Ideally we do not need a page context for those tests at all
// For now the dashboard avoids that we have failing requests due to conflicts when updating the file
cy.visit('/apps/dashboard')
cy.propfindFolder('/')
.should('have.property', richWorkspace, '')
cy.uploadFile('test.md', 'text/markdown', '/Readme.md')
cy.propfindFolder('/')
.should('have.property', richWorkspace, '## Hello world\n')
cy.deleteFile('/Readme.md')
cy.propfindFolder('/')
.should('have.property', richWorkspace, '')
})
// Android app relies on this when navigating nested folders
it('adds rich workspace property to nested folders', function() {
cy.createFolder('/workspace')
// FIXME: Ideally we do not need a page context for those tests at all
// For now the dashboard avoids that we have failing requests due to conflicts when updating the file
cy.visit('/apps/dashboard')
cy.propfindFolder('/', 1)
.then(results => results.pop().propStat[0].properties)
.should('have.property', richWorkspace, '')
cy.uploadFile('test.md', 'text/markdown', '/workspace/Readme.md')
cy.propfindFolder('/', 1)
.then(results => results.pop().propStat[0].properties)
.should('have.property', richWorkspace, '## Hello world\n')
})
})
describe('with workspaces disabled', function() {
beforeEach(function() {
cy.configureText('workspace_enabled', 0)
})
it('does not return a rich workspace property', function() {
// FIXME: Ideally we do not need a page context for those tests at all
// For now the dashboard avoids that we have failing requests due to conflicts when updating the file
cy.visit('/apps/dashboard')
cy.propfindFolder('/')
.should('not.have.property', richWorkspace)
cy.uploadFile('test.md', 'text/markdown', '/Readme.md')
cy.propfindFolder('/')
.should('not.have.property', richWorkspace)
cy.createFolder('/without-workspace')
cy.propfindFolder('/', 1)
.then(results => results.pop().propStat[0].properties)
.should('not.have.property', richWorkspace)
})
})
})