mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-02-17 07:33:57 +00:00
test: migration from Python to JavaScript
This commit is contained in:
@@ -82,7 +82,7 @@ describe('Sieve', function() {
|
||||
it('enable vacation script - ignore lists', async function() {
|
||||
const vacationMsg = 'vacation test - ignore list'
|
||||
const daysInterval = 3
|
||||
const mailaddr = user.email
|
||||
const mailaddr = user.email.replace(/mailto:/, '')
|
||||
const sieveVacationIgnoreLists = `require ["vacation"];\r\nif allof ( not exists ["list-help", "list-unsubscribe", "list-subscribe", "list-owner", "list-post", "list-archive", "list-id", "Mailing-List"], not header :comparator "i;ascii-casemap" :is "Precedence" ["list", "bulk", "junk"], not header :comparator "i;ascii-casemap" :matches "To" "Multiple recipients of*" ) { vacation :days ${daysInterval} :addresses ["${mailaddr}"] text:\r\n${vacationMsg}\r\n.\r\n;\r\n}\r\n`
|
||||
let vacation
|
||||
|
||||
@@ -90,7 +90,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.setNoSave('ignoreLists', 1)
|
||||
await prefs.save()
|
||||
|
||||
|
||||
@@ -6,10 +6,15 @@ const path = require('path')
|
||||
const { execSync } = require('child_process')
|
||||
|
||||
describe('sogo-tool tests', function() {
|
||||
let tmpdir
|
||||
let tmpdir, userdir
|
||||
|
||||
beforeAll(function() {
|
||||
const { homedir } = os.userInfo()
|
||||
userdir = homedir
|
||||
})
|
||||
|
||||
beforeEach(function() {
|
||||
tmpdir = mkdtempSync(path.join(os.tmpdir(), 'sogo-'))
|
||||
tmpdir = mkdtempSync(path.join(homedir, 'sogo-'))
|
||||
})
|
||||
|
||||
afterEach(function() {
|
||||
|
||||
Reference in New Issue
Block a user