test: improve functions names related to sync-collection

This commit is contained in:
Francis Lachapelle
2022-01-21 16:56:54 -05:00
parent 54b163da2d
commit bf36279e0e
4 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -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: {
+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -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)
+2 -2
View File
@@ -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)