Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add e2e tests for transactions filtering by isScCall parameter #1447

Merged
merged 3 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/load-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: k6 run ./k6/script.js

- name: Upload result file for base branch
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: base-results
path: k6/output/summary.json
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
run: k6 run ./k6/script.js

- name: Upload result file for head branch
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: head-results
path: k6/output/summary.json
Expand All @@ -135,7 +135,7 @@ jobs:
- uses: actions/checkout@v2

- name: Download all artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts

Expand All @@ -159,7 +159,7 @@ jobs:
head: ${{ github.event.pull_request.head.sha }}

- name: Upload the report markdown
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: github.event_name == 'pull_request'
with:
name: report-markdown
Expand Down
29 changes: 29 additions & 0 deletions src/test/chain-simulator/transactions.cs-e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,35 @@ describe('Transactions e2e tests with chain simulator', () => {
}
}
});

it('should return transactions filtered by isScCall parameter', async () => {
const response = await axios.get(`${config.apiServiceUrl}/transactions?isScCall=true`);
expect(response.status).toBe(200);

for (const transaction of response.data) {
expect(transaction.isScCall).toBe(true);
}
});

it('should handle isScCall field appropriately when isScCall parameter is not provided', async () => {
const response = await axios.get(`${config.apiServiceUrl}/transactions`);
expect(response.status).toBe(200);
expect(response.data.length).toBeGreaterThan(0);

const hasScCalls = response.data.some((tx: { isScCall?: boolean }) => tx.isScCall === true);
const hasNonScCalls = response.data.some((tx: { isScCall?: boolean }) => tx.isScCall === false);

expect(hasScCalls || hasNonScCalls).toBe(true);
});

it('should return transactions without isScCall field when isScCall parameter is false', async () => {
const response = await axios.get(`${config.apiServiceUrl}/transactions?isScCall=false`);
expect(response.status).toBe(200);

for (const transaction of response.data) {
expect(transaction.isScCall).toBeUndefined();
}
});
});

describe('GET /transactions/count', () => {
Expand Down