fix(tests): Add timeout on all async tests

This commit is contained in:
smizrahi
2024-09-26 17:15:27 +02:00
parent 59d48cb382
commit 8e249d4abf
15 changed files with 55 additions and 55 deletions
+3 -3
View File
@@ -132,7 +132,7 @@ describe('PreventInvitations', function() {
.toBe(0)
await _addAttendee()
await _verifyEvent()
})
}, config.timeout || 10000)
it(`Enable, refuse the invitation`, async function() {
// Second, enable PreventInviation and refuse it
@@ -144,7 +144,7 @@ describe('PreventInvitations', function() {
.toBe(1)
await _addAttendee(409)
await _verifyEvent(404)
})
}, config.timeout || 10000)
it(`Enable, update whitelist, accept the invitation`, async function() {
// First, add the Organiser to the Attendee's whitelist
@@ -161,5 +161,5 @@ describe('PreventInvitations', function() {
// Second, try again to invite, it should work
await _addAttendee()
await _verifyEvent()
})
}, config.timeout || 10000)
})
+4 -4
View File
@@ -20,7 +20,7 @@ describe('read and set calendar properties', function() {
expect(response[0].status)
.withContext(`HTTP status code of MKCALENDAR`)
.toEqual(405)
})
}, config.timeout || 10000)
// CalDAVPropertiesTest
@@ -36,7 +36,7 @@ describe('read and set calendar properties', function() {
expect(Object.keys(prop.scheduleCalendarTransp).includes('opaque'))
.withContext('schedule-calendar-transp is "opaque" on new')
.toBeTrue()
})
}, config.timeout || 10000)
it("proppatch", async function() {
let newValueNode
@@ -65,7 +65,7 @@ describe('read and set calendar properties', function() {
expect(results[0].status)
.withContext(`Setting transparency to ${newValueNode} is successful`)
.toBe(207)
})
}, config.timeout || 10000)
it("calendar-query", async function() {
const filename = `new.ics`
@@ -125,5 +125,5 @@ END:VCALENDAR`
expect(utility.componentsAreEqual(response[0].props.calendarData, event))
.withContext(`Returned vCalendar matches ${filename}`)
.toBe(true)
})
}, config.timeout || 10000)
})
+10 -10
View File
@@ -163,7 +163,7 @@ describe('CalDAV Scheduling', function() {
expect(veventAttendee.getFirstProperty('uid').getFirstValue())
.withContext(`UID in organizer's calendar and attendees's calendar are identical`)
.toBe(vevent.getFirstProperty('uid').getFirstValue())
})
}, config.timeout || 10000)
it('Remove attendee after event creation', async function() {
const icsName = 'test-remove-attendee.ics'
@@ -213,7 +213,7 @@ describe('CalDAV Scheduling', function() {
// 6. verify that the attendee doesn't have the event anymore
await _getEvent(webdavAttendee1, attendee1Calendar, icsName, 404)
})
}, config.timeout || 10000)
it('try to overbook a resource', async function() {
const icsName = 'test-no-overbook.ics'
@@ -260,7 +260,7 @@ describe('CalDAV Scheduling', function() {
// put the event - should trigger a 409
await _putEvent(webdav, userCalendar, obIcsName, vcalendar, 409)
})
}, config.timeout || 10000)
it('try to overbook a resource - multiplebookings=0', async function() {
const icsName = 'test-can-overbook.ics'
@@ -307,7 +307,7 @@ describe('CalDAV Scheduling', function() {
// put the event - should be fine since we can overbook this one
await _putEvent(webdav, userCalendar, obIcsName, vcalendar)
})
}, config.timeout || 10000)
it('Resource booking overlap detection - bug #1837', async function() {
// There used to be some problems with recurring events and resources booking
@@ -408,7 +408,7 @@ describe('CalDAV Scheduling', function() {
vevent.addProperty(utility.createDateTimeProperty('dtend', nenddate))
vevent.updatePropertyWithValue('uid', 'recurring - nooverlap')
await _putEvent(webdav, userCalendar, overlapRecurringIcsName, vcalendarNoOverlap, 409)
})
}, config.timeout || 10000)
it('RRULE exception invitation dance', async function() {
// This workflow is based on what lightning 1.2.1 does
@@ -541,7 +541,7 @@ describe('CalDAV Scheduling', function() {
vcalendarOrganizer.removeSubcomponent(veventException)
await _putEvent(webdav, userCalendar, icsName, vcalendarOrganizer, 204)
await _getEvent(webdavAttendee1, attendee1Calendar, icsName, 404)
})
}, config.timeout || 10000)
it ('RRULE invitation delete exdate dance', async function() {
// Workflow:
@@ -658,7 +658,7 @@ describe('CalDAV Scheduling', function() {
expect(attendee.getParameter('partstat'))
.withContext('Partstat of attendee is declined for the exception')
.toBe('DECLINED')
})
}, config.timeout || 10000)
it('iCal organizer is attendee - bug #1839', async function() {
const icsName = 'test-organizer-is-attendee.ics'
@@ -709,7 +709,7 @@ describe('CalDAV Scheduling', function() {
.withContext(`Organizer is not an attendee`)
.not.toBe(user.email)
}
})
}, config.timeout || 10000)
it('PUT 2 events with the same UID - bug #1853', async function () {
const icsName = 'test-same-uid.ics'
@@ -731,7 +731,7 @@ describe('CalDAV Scheduling', function() {
// PUT the same event with a new filename - should trigger a 409
await _putEvent(webdav, userCalendar, conflictIcsName, vcalendar, 409)
})
}, config.timeout || 10000)
it('invitation delegation', async function () {
const icsName = 'test-delegation.ics'
@@ -933,5 +933,5 @@ describe('CalDAV Scheduling', function() {
vcalendarInvitationAttendee = await _getEvent(webdavAttendee1, attendee1Calendar, icsName, 404)
vcalendarInvitationDelegate = await _getEvent(webdavAttendee1Delegate, attendee1DelegateCalendar, icsName, 404)
}, 10000) // increase timeout for this long test
}, config.timeout || 10000) // increase timeout for this long test
})
+4 -4
View File
@@ -102,7 +102,7 @@ describe('CardDAV extensions', function() {
expect(response[0].status)
.withContext(`HTTP status code of MKCOL`)
.toEqual(405)
})
}, config.timeout || 10000)
// CARDDAV:addressbook-query Report
// https://datatracker.ietf.org/doc/html/rfc6352#section-8.6
@@ -166,7 +166,7 @@ describe('CardDAV extensions', function() {
expect(utility.componentsAreEqual(response[0].props.addressData, cards[name]))
.withContext(`Returned vCard matches ${name}`)
.toBe(true)
})
}, config.timeout || 10000)
// CARDDAV:addressbook-query Report
// https://datatracker.ietf.org/doc/html/rfc6352#section-8.6
@@ -232,7 +232,7 @@ describe('CardDAV extensions', function() {
expect(emails)
.withContext(`Returned vCard has email of ${config.attendee1_username} (${config.attendee1})`)
.toContain(config.attendee1)
}, 10000) // increase timeout for this long test
}, config.timeout || 10000) // increase timeout for this long test
// CARDDAV:addressbook-multiget Report
// https://datatracker.ietf.org/doc/html/rfc6352#section-8.7
@@ -266,5 +266,5 @@ describe('CardDAV extensions', function() {
.withContext(`Cards returned in addressbook-multiget`)
.toBe(true)
}
})
}, config.timeout || 10000)
})
+1 -1
View File
@@ -34,5 +34,5 @@ describe('config tests', function() {
.toBeUndefined()
userHash[user] = true
}
})
}, config.timeout || 10000)
})
+8 -8
View File
@@ -210,33 +210,33 @@ END:VCARD`
it("'view' only", async function() {
await _testRights({ v: true })
})
}, config.timeout || 10000)
it("'edit' only", async function() {
await _testRights({ e: true })
})
}, config.timeout || 10000)
it("'create' only", async function() {
await _testRights({ c: true })
})
}, config.timeout || 10000)
it("'delete' only", async function() {
await _testRights({ d: true })
})
}, config.timeout || 10000)
it("'create', 'delete'", async function() {
await _testRights({ c: true, d: true })
})
}, config.timeout || 10000)
it("'view', 'delete'", async function() {
await _testRights({ v: true, d: true })
})
}, config.timeout || 10000)
it("'edit', 'create'", async function() {
await _testRights({ c: true, e: true })
})
}, config.timeout || 10000)
it("'edit', 'delete'", async function() {
await _testRights({ d: true, e: true })
})
}, config.timeout || 10000)
})
+7 -7
View File
@@ -423,30 +423,30 @@ END:VCALENDAR`
it("'view all' on a specific class (PUBLIC)", async function() {
await _testRights({ pu: 'v' })
})
}, config.timeout || 10000)
it("'modify' PUBLIC, 'view all' PRIVATE, 'view d&t' confidential", async function() {
await _testRights({ pu: 'm', pr: 'v', co: 'd' })
})
}, config.timeout || 10000)
it("'create' only", async function() {
await _testRights({ c: true })
})
}, config.timeout || 10000)
it("'delete' only", async function() {
await _testRights({ d: true })
})
}, config.timeout || 10000)
it("'create', 'delete', 'view d&t' PUBLIC, 'modify' PRIVATE", async function() {
await _testRights({ c: true, d: true, pu: 'd', pr: 'm' })
})
}, config.timeout || 10000)
it("'create', 'respond to' PUBLIC", async function() {
await _testRights({ c: true, pu: 'r' })
})
}, config.timeout || 10000)
it("no right given", async function() {
await _testRights({})
})
}, config.timeout || 10000)
})
+3 -3
View File
@@ -131,7 +131,7 @@ describe('Apple iCal', function() {
.withContext(`DAV header includes class ${davClass}`)
.toBeTrue()
}
})
}, config.timeout || 10000)
it(`calendar-proxy as used from iCal`, async function() {
let membership, perm, users, proxyFor
@@ -175,7 +175,7 @@ describe('Apple iCal', function() {
expect(proxyFor).toContain(`/SOGo/dav/${owner}/`)
}
}
})
}, config.timeout || 10000)
it('calendar-proxy as used from SOGo', async function() {
const personalResource = `/SOGo/dav/${config.username}/Calendar/personal/`
@@ -229,5 +229,5 @@ describe('Apple iCal', function() {
.toBe(0)
await webdav_su.deleteObject(otherResource)
}, 10000) // increase timeout for this long test
}, config.timeout || 10000) // increase timeout for this long test
})
+2 -2
View File
@@ -35,7 +35,7 @@ describe('calendar classification', function() {
expect(status)
.withContext('Setting an invalid classification')
.toBe(403)
})
}, config.timeout || 10000)
it('setting a valid classification', async function() {
for (let component of ['events', 'tasks']) {
@@ -46,5 +46,5 @@ describe('calendar classification', function() {
.toBe(207)
}
}
})
}, config.timeout || 10000)
})
+2 -2
View File
@@ -150,7 +150,7 @@ describe('public access', function() {
.withContext('First href must be the Calendar parent collection')
.toBe(parentColl)
})
}, config.timeout || 10000)
it("user accessing (non-)shared Calendars", async function() {
const parentColl = `/SOGo/dav/${config.subscriber_username}/Calendar/`
@@ -176,6 +176,6 @@ describe('public access', function() {
expect(href)
.withContext('Unique href must be the Calendar parent collection')
.toBe(parentColl)
})
}, config.timeout || 10000)
})
+1 -1
View File
@@ -111,6 +111,6 @@ END:VCALENDAR`
// 4. Delete
const response = await webdav_su.deleteObject(resource)
expect(response.status).toBe(204)
})
}, config.timeout || 10000)
})
+1 -1
View File
@@ -64,5 +64,5 @@ describe('contacts categories', function() {
.toContain('Toto')
expect(results)
.toContain('Cuicui')
})
}, config.timeout || 10000)
})
+4 -4
View File
@@ -11,21 +11,21 @@ describe('public access', function() {
expect(status)
.withContext('/SOGo/so/public must not be accessible')
.toBe(404)
})
}, config.timeout || 10000)
it("access to /SOGo/public", async function() {
const [{ status }] = await webdav_anon.options('/SOGo/public')
expect(status)
.withContext('/SOGo/public must not be accessible')
.toBe(404)
})
}, config.timeout || 10000)
it("access to non-public resource", async function() {
const [{ status }] = await webdav_anon.options(`/SOGo/dav/${config.username}`)
expect(status)
.withContext('DAV non-public resources should request authentication')
.toBe(401)
})
}, config.timeout || 10000)
it("access to public resource", async function() {
const [{ status }] = await webdav_anon.options('/SOGo/dav/public')
@@ -35,5 +35,5 @@ describe('public access', function() {
expect(status)
.withContext('DAV public resources must be accessible')
.toBe(200)
})
}, config.timeout || 10000)
})
+1 -1
View File
@@ -45,6 +45,6 @@ describe('HTTP Calendar', function() {
expect(response.status)
.withContext(`HTTP status code when unsubscribing to a Web calendar`)
.toBe(204)
})
}, config.timeout || 10000)
})
+4 -4
View File
@@ -26,12 +26,12 @@ describe('preferences', function() {
it('Set/get a text preference - normal characters', async function() {
await _setTextPref('defaultText')
})
}, config.timeout || 10000)
it('Set/get a text preference - weird characters - used to crash on 1.3.12', async function() {
const prefText = `weird data \ ' \"; ^`
await _setTextPref(prefText)
})
}, config.timeout || 10000)
it('Set/get the PreventInvitation pref', async function() {
await prefs.set('PreventInvitations', 0)
@@ -44,7 +44,7 @@ describe('preferences', function() {
expect(isset.PreventInvitations)
.withContext(`Set/get Settings/Calendar/PreventInvitations (1)`)
.toEqual(1)
})
}, config.timeout || 10000)
it('Set/get the PreventInvitations Whitelist', async function() {
await prefs.set('PreventInvitationsWhitelist', config.white_listed_attendee)
@@ -52,5 +52,5 @@ describe('preferences', function() {
expect(whitelist.PreventInvitationsWhitelist)
.withContext(`Set/get Settings/Calendar/PreventInvitationsWhitelist`)
.toEqual(config.white_listed_attendee)
})
}, config.timeout || 10000)
})