Skip to content

Commit 854030b

Browse files
authored
Merge pull request #496 from algorandfoundation/feature/add-indexer-tests
All 21 indexer endpoint tests are implemented, covering health check, accounts, applications, assets, blocks, and transactions. Each test validates responses against the generated Zod schemas and captures snapshots for regression testing.
2 parents 6cbf996 + f073673 commit 854030b

File tree

47 files changed

+57602
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+57602
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,4 @@ venv/
6868
ENV/
6969

7070
.polytest*/
71+
.algokit*/

package-lock.json

Lines changed: 12 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/indexer_client/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"dependencies": {},
2727
"peerDependencies": {},
2828
"devDependencies": {
29-
"@algorandfoundation/algokit-testing": "*"
29+
"@algorandfoundation/algokit-testing": "*",
30+
"zod": "^3.23.8"
3031
}
3132
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2+
3+
exports[`GET health > Common Tests > Basic request and response validation 1`] = `
4+
{
5+
"data": {
6+
"migration-required": false,
7+
"read-only-mode": true,
8+
},
9+
"dbAvailable": true,
10+
"isMigrating": false,
11+
"message": "57772761",
12+
"round": 57772761n,
13+
"version": "3.9.0",
14+
}
15+
`;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2+
3+
exports[`GET v2_accounts > Common Tests > Basic request and response validation 1`] = `
4+
{
5+
"accounts": [
6+
{
7+
"address": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ",
8+
"amount": 416118344628n,
9+
"amountWithoutPendingRewards": 416118344628n,
10+
"createdAtRound": 3331015n,
11+
"deleted": false,
12+
"minBalance": 100000n,
13+
"pendingRewards": 0n,
14+
"rewardBase": 27521n,
15+
"rewards": 74126551n,
16+
"round": 57774717n,
17+
"status": "Offline",
18+
"totalAppsOptedIn": 0,
19+
"totalAssetsOptedIn": 0,
20+
"totalBoxBytes": 0,
21+
"totalBoxes": 0,
22+
"totalCreatedApps": 0,
23+
"totalCreatedAssets": 0,
24+
},
25+
],
26+
"currentRound": 57774717n,
27+
"nextToken": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ",
28+
}
29+
`;

0 commit comments

Comments
 (0)