Skip to content

Commit

Permalink
fix raw data test, was on the wrong test
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-ocean committed Feb 27, 2024
1 parent 9ae398d commit 306fc7c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/test/integration/encryptFile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,10 @@ describe('Encrypt File', () => {
assert(response.status.httpStatus === 200, 'Failed to get 200 response')
assert(response.stream, 'Failed to get stream')
expect(response.stream).to.be.instanceOf(Readable)

expect(response.status.headers['Content-Type']).to.be.equal(
'application/octet-stream'
)
expect(response.status.headers['X-Encrypted-By']).to.be.equal(
config.keys.peerId.toString()
)
expect(response.status.headers['X-Encrypted-Method']).to.be.equal(EncryptMethod.AES)
})

it('should encrypt raw data file on body', async () => {
Expand All @@ -60,6 +57,12 @@ describe('Encrypt File', () => {
assert(response.status.httpStatus === 200, 'Failed to get 200 response')
assert(response.stream, 'Failed to get stream')
expect(response.stream).to.be.instanceOf(Readable)
const expectedHeaders = {
'Content-Type': 'application/octet-stream',
'X-Encrypted-By': config.keys.peerId.toString(),
'X-Encrypted-Method': EncryptMethod.AES
}
expect(response.status.headers).to.deep.equal(expectedHeaders)
})

it('should return unknown file type', async () => {
Expand Down

0 comments on commit 306fc7c

Please sign in to comment.