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

Commit

Permalink
add envelope and encryption-method-name
Browse files Browse the repository at this point in the history
fixes #114 & #115
  • Loading branch information
tboeckmann committed Nov 26, 2019
1 parent 3fffe96 commit d09afc6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/models/outbound-mail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ export class OutboundMail {
"public-key": "",
"subject": ""
};
public envelope: string = "0x01";
public "encryption-method-name": string = "aes256cbc";
}

22 changes: 22 additions & 0 deletions src/app/services/mailchain/messages/send.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,27 @@ describe('SendService', () => {
expect(req.request.method).toBe("POST");
req.flush(body);
})

it('should specify envelope type "0x01" in the outbound mail', () => {
let outboundMailObject = mailchainTestService.outboundMailObject()
expect(outboundMailObject.envelope).toBe("0x01")
})

it('should error on send if envelope type is empty in the outbound mail', () => {
// TODO add test for: should error on send if envelope type is empty in the outbound mail
// let outboundMailObject = mailchainTestService.outboundMailObject()
// outboundMailObject.envelope = ""
})

it('should specify encryption-method-name as "aes256cbc" in the outbound mail', () => {
let outboundMailObject = mailchainTestService.outboundMailObject()
expect(outboundMailObject["encryption-method-name"]).toBe("aes256cbc")
})

it('should error on send if encryption-method-name is empty in the outbound mail', () => {
// TODO add test for: should error on send if encryption-method-name is empty in the outbound mail
// let outboundMailObject = mailchainTestService.outboundMailObject()
// outboundMailObject["encryption-method-name"] = ""
})
})
});

0 comments on commit d09afc6

Please sign in to comment.