Skip to content

Commit

Permalink
getAuthor test case for unsigned message
Browse files Browse the repository at this point in the history
  • Loading branch information
LiranCohen committed Sep 8, 2024
1 parent 79b6f38 commit 3a43054
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/core/message.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ describe('Message', () => {
const signer = Message.getSigner(message);
expect(signer).to.equal(deviceX.did);
});

it('returns undefined for an unsigned message', async () => {
const { message } = await RecordsRead.create({
filter: {
recordId: await TestDataGenerator.randomCborSha256Cid()
}
});

const author = Message.getAuthor(message);
expect(author).to.be.undefined;
});
});

describe('getSigner()', () => {
Expand Down

0 comments on commit 3a43054

Please sign in to comment.