Add conversation threads and prepare 0.6.0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -32,11 +32,16 @@ test('encrypts and signs for a recipient and the sender can read the copy', asyn
|
||||
const alice = await actor('Alice', 'alice@example.com');
|
||||
const bob = await actor('Bob', 'bob@example.com');
|
||||
await exchange(alice, bob);
|
||||
const { raw, envelope } = await alice.mail.build(sendOptions(alice, 'Bob <bob@example.com>', { encrypt: true, sign: true, passphrase: alice.passphrase }));
|
||||
const { raw, envelope } = await alice.mail.build(sendOptions(alice, 'Bob <bob@example.com>', {
|
||||
encrypt: true, sign: true, passphrase: alice.passphrase,
|
||||
inReplyTo: '<parent@example.test>', references: '<root@example.test> <parent@example.test>'
|
||||
}));
|
||||
assert.deepEqual(envelope.to, ['bob@example.com']);
|
||||
assert.ok(!raw.toString('latin1').includes('Top secret'));
|
||||
const parsed = await simpleParser(raw);
|
||||
assert.equal(parsed.subject, 'Héllo secrèt');
|
||||
assert.equal(parsed.inReplyTo, '<parent@example.test>');
|
||||
assert.deepEqual(parsed.references, ['<root@example.test>', '<parent@example.test>']);
|
||||
assert.equal(detect(parsed), 'encrypted-mime');
|
||||
await assert.rejects(() => bob.mail.decrypt(parsed), error => error.code === 'PASSPHRASE_REQUIRED');
|
||||
await assert.rejects(() => bob.mail.decrypt(parsed, { passphrase: 'wrong wrong' }), error => error.code === 'BAD_PASSPHRASE');
|
||||
|
||||
Reference in New Issue
Block a user