test: migration from Python to JavaScript

This commit is contained in:
Francis Lachapelle
2021-11-09 21:56:11 -05:00
parent d7fde6d2bb
commit c860bf4f58
3 changed files with 6 additions and 4 deletions

View File

@@ -624,5 +624,5 @@ describe('MailDAV', function() {
await _testProperty(msg1Loc, DAVMailHeader, 'references', '<4AC3BF1B.3010806@inverse.ca>')
await _testProperty(msg1Loc, DAVMailHeader, 'subject', 'message1subject')
await _testProperty(msg1Loc, DAVMailHeader, 'to', ['message1to@cyril.dev'])
})
}, 30000) // increase timeout for this long test
})

View File

@@ -62,7 +62,7 @@ describe('Sieve', function() {
it('enable simple vacation script', async function() {
const vacationMsg = 'vacation test'
const daysInterval = 5
const mailaddr = user.email
const mailaddr = user.email.replace(/mailto:/, '')
const sieveSimpleVacation = `require ["vacation"];\r\nvacation :days ${daysInterval} :addresses ["${mailaddr}"] text:\r\n${vacationMsg}\r\n.\r\n;\r\n`
let vacation
@@ -70,7 +70,7 @@ describe('Sieve', function() {
vacation.enabled = 1
await prefs.setNoSave('autoReplyText', vacationMsg)
await prefs.setNoSave('daysBetweenResponse', daysInterval)
await prefs.setNoSave('autoReplyEmailAddresses', [user.email])
await prefs.setNoSave('autoReplyEmailAddresses', [mailaddr])
await prefs.save()
const createdScript = await _getSogoSieveScript()

View File

@@ -17,7 +17,9 @@ describe('sogo-tool tests', function() {
})
it('backup', async function() {
execSync(`sogo-tool backup ${tmpdir} ${config.username}`, (error, stdout, stderr) => {
const { uid } = os.userInfo()
const sudo = uid == 0 ? `sudo -u sogo ` : ``
execSync(`${sudo}sogo-tool backup ${tmpdir} ${config.username}`, (error, stdout, stderr) => {
expect(error).not.toBeDefined()
})
})