From bfe5a6f4864102b608eb1a27ec7ffb906ccff0f8 Mon Sep 17 00:00:00 2001 From: Preston Maness Date: Wed, 14 Jun 2023 13:31:12 -0500 Subject: [PATCH] Add test for whitespace handling of plaintext proofs --- test/verifications.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/verifications.test.js b/test/verifications.test.js index 76ff6d1..1a50642 100644 --- a/test/verifications.test.js +++ b/test/verifications.test.js @@ -23,6 +23,9 @@ const fingerprint = '3637202523e7c1309ab79e99ef2dc5827b445f4b' const plaintextCorrectProofData = [ 'openpgp4fpr:3637202523e7c1309ab79e99ef2dc5827b445f4b' ] +const plaintextCorrectProofDataWithWhitespace = [ + 'openpgp4fpr: 3637 2025 23e7 c130 9ab7 9e99 ef2d c582 7b44 5f4b' +] const plaintextIncorrectProofData = [ 'openpgp4pr:b4f544b7285cd2fe99e97ba9031c7e3252027363' ] @@ -48,6 +51,11 @@ describe('verifications.run', () => { const result = await doipjs.verifications.run(plaintextCorrectProofData, claimData, fingerprint) expect(result.result).to.be.true }) + // issue #22 + it('should handle a plaintext proof with whitespace', async () => { + const result = await doipjs.verifications.run(plaintextCorrectProofDataWithWhitespace, claimData, fingerprint) + expect(result.result).to.be.true + }) it('should reject a wrong plaintext proof', async () => { const result = await doipjs.verifications.run(plaintextIncorrectProofData, claimData, fingerprint) expect(result.result).to.be.false