Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
Test displayname, selfstatus and e2ee_enabled config
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphtheninja committed Aug 28, 2018
1 parent 799fb73 commit dd059fa
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/index.js
Expand Up @@ -24,8 +24,14 @@ test('missing addr and/or mail_pw throws', t => {
t.end()
})

// TODO 1. to 4. below would cover dc.open() completely
// 1. test dc.open() where mkdirp fails (e.g. with no permissions)
// 2. test failing dc._open() (what would make it fail in core?)
// 3. test setting up context with e2ee_enabled set to false + close
// 4. test opening an already configured account (re-open above)

test('setUp dc context', t => {
t.plan(16)
t.plan(19)
const cwd = tempy.directory()
dc = new DeltaChat({
addr: 'delta1@delta.localhost',
Expand All @@ -38,6 +44,9 @@ test('setUp dc context', t => {
send_user: 'delta1',
send_pw: 'delta1',
server_flags: 0x400 | 0x40000,
displayname: 'Delta One',
selfstatus: 'From Delta One with <3',
e2ee_enabled: true,
cwd
})
dc.once('ready', () => {
Expand All @@ -53,6 +62,9 @@ test('setUp dc context', t => {
t.is(dc.getConfig('send_user'), 'delta1', 'send_user correct')
t.is(dc.getConfig('send_pw'), 'delta1', 'send_pw correct')
t.is(dc.getConfigInt('server_flags'), 0x400 | 0x40000, 'server_flags correct')
t.is(dc.getConfig('displayname'), 'Delta One', 'displayname correct')
t.is(dc.getConfig('selfstatus'), 'From Delta One with <3', 'selfstatus correct')
t.is(dc.getConfigInt('e2ee_enabled'), 1, 'e2ee enabled')
t.is(typeof dc.getInfo(), 'string', 'info is a string')
t.is(dc.getBlobdir(), `${cwd}/db.sqlite-blobs`, 'correct blobdir')
})
Expand Down

0 comments on commit dd059fa

Please sign in to comment.