mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-21 03:15:25 +00:00
test: improve functions names related to sync-collection
This commit is contained in:
+2
-2
@@ -329,7 +329,7 @@ class WebDAV {
|
||||
}
|
||||
|
||||
// https://datatracker.ietf.org/doc/html/rfc6578#section-3.2
|
||||
syncQuery(resource, token = '', properties) {
|
||||
syncCollectionRaw(resource, token = '', properties) {
|
||||
const formattedProperties = properties.map((p) => {
|
||||
return { [`${DAVNamespaceShorthandMap[DAVNamespace.DAV]}:${p}`]: '' }
|
||||
});
|
||||
@@ -445,7 +445,7 @@ class WebDAV {
|
||||
})
|
||||
}
|
||||
|
||||
syncColletion(resource) {
|
||||
syncCollection(resource) {
|
||||
return davRequest({
|
||||
url: this.serverUrl + resource,
|
||||
init: {
|
||||
|
||||
@@ -159,7 +159,7 @@ END:VCALENDAR`
|
||||
const iscClass = classToICSClass[eventClass].toLowerCase()
|
||||
const filename = `${iscClass}-event.ics`
|
||||
let event = undefined
|
||||
const results = await webdav_subscriber.syncColletion(resource)
|
||||
const results = await webdav_subscriber.syncCollection(resource)
|
||||
if (results.status !== 404) {
|
||||
results.find(o => {
|
||||
if (o.href == resource + filename) {
|
||||
|
||||
@@ -85,7 +85,7 @@ END:VCALENDAR`
|
||||
|
||||
// 2. Read - webdav-sync
|
||||
|
||||
results = await webdav_su.syncColletion(resource)
|
||||
results = await webdav_su.syncCollection(resource)
|
||||
expect(results.length).toBe(1)
|
||||
expect(results.find(o => {
|
||||
expect(o.status).toBe(201)
|
||||
|
||||
@@ -35,7 +35,7 @@ describe('webdav sync', function() {
|
||||
// without a token (query3)
|
||||
// with a token (query4))
|
||||
|
||||
response = await webdav.syncQuery(resource, null, [ 'getetag' ])
|
||||
response = await webdav.syncCollectionRaw(resource, null, [ 'getetag' ])
|
||||
xml = await response.text();
|
||||
({ [`${nsShort}:multistatus`]: { [`${nsShort}:sync-token`]: { _text: token } } } = convert.xml2js(xml, {compact: true, nativeType: true}))
|
||||
expect(response.status)
|
||||
@@ -47,7 +47,7 @@ describe('webdav sync', function() {
|
||||
|
||||
// we make sure that any token is accepted when the collection is
|
||||
// empty, but that the returned token differs
|
||||
response = await webdav.syncQuery(resource, '1234', [ 'getetag' ])
|
||||
response = await webdav.syncCollectionRaw(resource, '1234', [ 'getetag' ])
|
||||
xml = await response.text();
|
||||
({ [`${nsShort}:multistatus`]: { [`${nsShort}:sync-token`]: { _text: token } } } = convert.xml2js(xml, {compact: true, nativeType: true}))
|
||||
expect(response.status)
|
||||
|
||||
Reference in New Issue
Block a user