mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-29 10:02:43 +00:00
test: migration from Python to JavaScript
This commit is contained in:
38
Tests/spec/ConfigSpec.js
Normal file
38
Tests/spec/ConfigSpec.js
Normal file
@@ -0,0 +1,38 @@
|
||||
import config from '../lib/config'
|
||||
|
||||
describe('config tests', function() {
|
||||
|
||||
fit('required configuration parameters', async function() {
|
||||
expect(config.hostname)
|
||||
.withContext(`Config 'hostname'`)
|
||||
.toBeDefined()
|
||||
expect(config.username)
|
||||
.withContext(`Config 'username'`)
|
||||
.toBeDefined()
|
||||
expect(config.subscriber_username)
|
||||
.withContext(`Config 'subscriber_username'`)
|
||||
.toBeDefined()
|
||||
expect(config.attendee1)
|
||||
.withContext(`Config 'attendee1'`)
|
||||
.toBeDefined()
|
||||
expect(config.attendee1_delegate)
|
||||
.withContext(`Config 'attendee1_delegate'`)
|
||||
.toBeDefined()
|
||||
expect(config.mailserver)
|
||||
.withContext(`Config 'mailserver'`)
|
||||
.toBeDefined()
|
||||
|
||||
expect(config.subscriber_username)
|
||||
.withContext(`Config 'subscriber_username' and 'attendee1_username'`)
|
||||
.toEqual(config.attendee1_username)
|
||||
|
||||
let userHash = {}
|
||||
const userList = [config.username, config.subscriber_username, config.attendee1_delegate_username]
|
||||
for (let user of userList) {
|
||||
expect(userHash[user])
|
||||
.withContext(`username, subscriber_username, attendee1_delegate_username must all be different users ('${user}')`)
|
||||
.toBeUndefined()
|
||||
userHash[user] = true
|
||||
}
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user