Skip to content

test: offline Soroban RPC fixture, referral tests, task verification integration tests, cross-browser matrix - #1422

Merged
joelpeace48-cell merged 1 commit into
FinesseStudioLab:mainfrom
zerroai:test/rpc-fixture-cross-browser-referral-task-verification
Oct 18, 2026
Merged

joelpeace48-cell merged 1 commit into
FinesseStudioLab:mainfrom
zerroai:test/rpc-fixture-cross-browser-referral-task-verification

Conversation

@zerroai

@zerroai zerroai commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Summary

#1325 – Mock Soroban RPC fixture. New backend/src/mocks/mockSorobanRpc.js. createMockSorobanRpc() is an in-memory JSON-RPC endpoint with valid-shaped defaults for getHealth, getNetwork, getLatestLedger, getLedgerEntries, getEvents, simulateTransaction, sendTransaction and getTransaction (unique hashes, optional pending polls before a transaction resolves). Tests can override any method (setResponse, value or function of the params), inject failures (failNext, as a JSON-RPC error or an HTTP status), pin a transaction outcome (registerTransaction), move the ledger (advanceLedger), read recorded calls, and reset(). It plugs in as a fetch replacement (rpc.fetch) or as a real local HTTP server (startMockSorobanRpcServer()), so it works with checkSorobanRpcHealth and with the Stellar SDK rpc.Server with no network. mockSorobanRpc.test.js (9 tests) covers all of that. The existing minimal createMockSorobanServer in contractMocks.js is left as is.

#1328 – Cross-browser pipeline. frontend/playwright.config.js now has edge (msedge channel), mobile-chrome (Pixel 7), mobile-safari (iPhone 14) and mobile-edge (Pixel 7 on msedge) alongside the existing Chromium/Firefox/WebKit projects. The CI cross-browser-e2e job becomes a 7-entry matrix with an install mapping (msedge for the Edge projects, Chromium/WebKit for the mobile Chrome/Safari projects). The mobile projects run only cross-browser.spec.ts and basic.spec.js, because the wallet-extension specs assume a desktop browser. frontend/tests/e2e/README.md is updated. Verified the config loads and lists the expected tests per project (playwright test --list); the matrix has not run on CI before this PR.

#1329 – Referral tests. services/referralTiers.test.js (every tier boundary, progress and referrals-to-next, top tier, invalid input, monotonicity) and dal/sqliteReferralRepository.test.js against an in-memory SQLite database using the real 002_referrals migration: first-referrer attribution wins and duplicates are ignored, attribution is per campaign, a multi-level tree credits only direct referrals, leaderboard ranking with ties (1, 1, 3), pagination and campaign scoping, and referral counts moving a referrer across the silver and gold tier boundaries.

#1330 – Task verification integration tests. integration/taskVerification.integration.test.js runs the real route, service and HTTP client against local stand-ins for third-party APIs: a fake Twitter API v2 server (like, retweet, follow and tweet tasks, unknown users/targets, pagination bounded by maxPages, 429 with Retry-After, rejected credentials, upstream 5xx, unreachable API, missing token, invalid input) and signed GitHub webhook deliveries through the real routes and store (merged PR vs. closed-unmerged, completed vs. not-planned issues, redelivery idempotency, forged/missing/tampered signatures, unconfigured secret, ping, missing delivery id, invalid JSON, admin lookup). The repository has no Discord task verification code, so there is nothing to test for Discord yet; that part of the issue title is not covered.

Testing

node --test on the four new backend test files: 42 passing. Frontend Playwright config verified with playwright test --list for the new projects; e2e itself was not run locally (needs the browsers and a build).

Notes

  • The new backend tests do not import src/index.js, which currently fails to parse on main (and createApp cannot start because of the migration numbering); they use the individual route/service/repository modules so they run independently of that.
  • No application code changed.

Closes #1325
Closes #1328
Closes #1329
Closes #1330

@drips-wave

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@zerroai Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

},
};
}
const result = typeof produce === 'function' ? produce(params, api) : produce;
@joelpeace48-cell
joelpeace48-cell merged commit a8fefbf into FinesseStudioLab:main Oct 18, 2026
7 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants