Skip to content

Commit 8e1f870

Browse files
committed
feat: added 1 more test for NodesClaimGet
1 parent 77c4b32 commit 8e1f870

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/nodes/agent/handlers/nodesClaimsGet.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,5 +329,21 @@ describe('nodesClaimsGet', () => {
329329
expect(isSorted).toBe(true);
330330
});
331331

332+
test('Should return no results when the DB is empty', async () => {
333+
// We do not add any claims to the DB here, leaving it empty
334+
335+
// Make the RPC call without any parameters
336+
const response = await rpcClient.methods.nodesClaimsGet({});
337+
338+
// Collect all results into an array
339+
const claimIds: Array<string> = [];
340+
for await (const claim of response) {
341+
claimIds.push(claim.claimIdEncoded ?? '');
342+
}
343+
344+
// Verify the array is empty
345+
expect(claimIds).toHaveLength(0);
346+
});
347+
332348

333349
});

0 commit comments

Comments
 (0)