Skip to content

Commit

Permalink
test(signature-fetcher): add tests getting signatures from store
Browse files Browse the repository at this point in the history
  • Loading branch information
karlprieb committed Sep 5, 2024
1 parent e939939 commit aeb6518
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/data/signature-fetcher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ describe('SignatureFetcher', () => {
assert.strictEqual(result, undefined);
});

it('should return signature from signature store if it exists', async () => {
mock.method(signatureStore, 'get', async () => 'signature-from-store');

const result = await signatureFetcher.getDataItemSignature('testId');

assert.strictEqual(result, 'signature-from-store');
});

it('should return signature if it exists in attributes', async () => {
const testSignature = 'testSignature';
mock.method(dataIndex, 'getDataItemAttributes', async () => ({
Expand Down Expand Up @@ -124,6 +132,14 @@ describe('SignatureFetcher', () => {
assert.strictEqual(result, undefined);
});

it('should return signature from signature store if it exists', async () => {
mock.method(signatureStore, 'get', async () => 'signature-from-store');

const result = await signatureFetcher.getDataItemSignature('testId');

assert.strictEqual(result, 'signature-from-store');
});

it('should return signature if it exists in attributes', async () => {
const testSignature = 'testSignature';
mock.method(dataIndex, 'getTransactionAttributes', async () => ({
Expand Down

0 comments on commit aeb6518

Please sign in to comment.