feat: implement unit tests and creator event features#917
Open
djcdz4 wants to merge 1 commit into
Open
Conversation
…rena1X#879, Arena1X#881, Arena1X#886) ## Arena1X#763 — Backend unit tests for services - Add comprehensive unit tests for ContractService covering all view function calls (getEvent, getMatch, getEventMatches, getUserPredictions, getEventParticipants, getEventWinners, getConfig, getCreationFee, isVerified, getEventStatistics, getPredictionDistribution), retry logic with 3-attempt exhaustion, and RPC simulation paths including error, missing retval, and transient-retry-then-succeed scenarios - Expand AnalyticsService tests to cover getDashboardKPIs aggregation, streak calculation, getMarketHistory date filters, logActivity, getMarketAnalytics outcome distribution, getCategoryAnalytics sorting/trending logic, and getUserTrends with days clamping - Expand NotificationsService tests to cover create, findAllForUser (read filter, type filter, pagination skip/take, limit cap), markAsRead, markAllAsRead, remove (including NotFoundException), markMultipleAsRead, and getUnreadCount - All tests use mocks for external dependencies (Stellar SDK, TypeORM repositories); no real network or database calls ## Arena1X#879 — Create Creator Event Page at /creator-events/create - Add `frontend/src/app/(authenticated)/creator-events/create/page.tsx` with breadcrumb navigation and page header - Add `frontend/src/component/creator-events/CreateEventForm.tsx` implementing a 3-step multi-step form: - Step 1: event title (max 200 chars), description (max 1000 chars, markdown supported), max participants (2–1000) with field validation - Step 2: creation fee display (XLM), event summary, wallet address check, "Create Event & Pay Fee" button with transaction signing state - Step 3: success view with generated 8-character invite code, copy button, Twitter/Telegram/copy-link share buttons, "Add Matches" redirect to /creator-events/[id]/matches - Draft persistence via localStorage with "Save as Draft" button ## Arena1X#881 — Match Management Page at /creator-events/[id]/matches - Add `frontend/src/app/(authenticated)/creator-events/[id]/matches/page.tsx` with creator-only access guard (redirects non-creators to event detail), breadcrumb navigation, existing matches list with status badges (Upcoming/Started/Resolved), edit button for upcoming matches, delete button for matches without predictions, and 100-match cap warning - Add `frontend/src/component/creator-events/AddMatchForm.tsx` with Team A / Team B name inputs (max 100 chars), datetime-local picker requiring a future time, duplicate match detection, and full client-side validation - Add `frontend/src/component/creator-events/BulkMatchUpload.tsx` with CSV file upload, row-by-row parsing and validation (empty teams, same-team names, invalid/past ISO 8601 dates), preview table with valid/error counts, remaining-slot enforcement, and "Import All" submission ## Arena1X#886 — AI Oracle Dashboard at /oracle/creator-events - Add `frontend/src/app/(oracle)/creator-events/page.tsx` with stats cards (pending matches, total submitted, submitted today, avg delay), tabbed interface (Pending / Batch Submit / Recent), batch-select mode, and recent results list with Stellar Explorer tx hash links - Add `frontend/src/component/oracle/PendingMatchesList.tsx` with event filter dropdown, asc/desc sort by match time, batch-selection checkboxes, and per-match "Submit Result" button - Add `frontend/src/component/oracle/SubmitResultForm.tsx` modal with outcome selector (Team A Won / Team B Won / Draw), optional confidence score and data source inputs, transaction signing state, and post-submit success view with tx hash link - Add `frontend/src/component/oracle/BatchResultSubmission.tsx` with CSV upload (Match ID, Outcome columns), validation preview, and "Submit All Results" button - Add `frontend/src/component/oracle/OracleGuard.tsx` and OracleShell for agent-address access control with redirect for non-oracle wallets - Add `frontend/src/app/(oracle)/layout.tsx` wrapping oracle pages in OracleGuard + OracleShell Closes Arena1X#763 Closes Arena1X#879 Closes Arena1X#881 Closes Arena1X#886
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@djcdz4 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[Backend] — Implement Unit Tests for Services #763 [Backend] — Added comprehensive unit tests for
ContractService(all view functions, retry logic, RPC simulation), expanded tests forAnalyticsService(KPIs, streaks, market history, category analytics, user trends), andNotificationsService(CRUD, pagination filters, unread count). All tests mock external dependencies (Stellar SDK, TypeORM repositories).[Frontend] — ENHANCEMENT: Add Create Creator Event Page at
/creator-events/create#879 [Frontend] — Implemented/creator-events/createpage with a 3-step multi-step form: event details (title, description, max participants), review & pay fee (XLM fee display, wallet check, transaction signing), and success (invite code display, copy/share buttons, redirect to matches). Includes localStorage draft persistence.[Frontend] — ENHANCEMENT: Add Match Management Page at
/creator-events/[id]/matches#881 [Frontend] — Implemented/creator-events/[id]/matchespage with creator-only access guard, existing matches list (status badges, edit/delete actions), individual match add form (team names, future-datetime picker, duplicate detection), and bulk CSV upload with row validation and preview before import.[Frontend] — ENHANCEMENT: Add AI Oracle Dashboard at
/oracle/creator-events#886 [Frontend] — Implemented/oracle/creator-eventsAI Oracle dashboard with stats cards, tabbed interface (Pending / Batch Submit / Recent Results), per-match result submission modal (outcome selector, confidence score, data source, tx hash link), batch CSV submission, and oracle wallet access guard.Files changed
Backend
backend/src/contract/contract.service.spec.ts— new comprehensive test suitebackend/src/analytics/analytics.service.spec.ts— expanded coveragebackend/src/notifications/notifications.service.spec.ts— expanded coverageFrontend
frontend/src/app/(authenticated)/creator-events/create/page.tsxfrontend/src/component/creator-events/CreateEventForm.tsxfrontend/src/app/(authenticated)/creator-events/[id]/matches/page.tsxfrontend/src/component/creator-events/AddMatchForm.tsxfrontend/src/component/creator-events/BulkMatchUpload.tsxfrontend/src/app/(oracle)/creator-events/page.tsxfrontend/src/app/(oracle)/layout.tsxfrontend/src/component/oracle/PendingMatchesList.tsxfrontend/src/component/oracle/SubmitResultForm.tsxfrontend/src/component/oracle/BatchResultSubmission.tsxfrontend/src/component/oracle/OracleGuard.tsxfrontend/src/component/oracle/OracleShell.tsxTest plan
cd backend && npm test— all contract, analytics, and notifications service specs pass/creator-events/create— 3-step form renders, draft saves/restores, step 2 shows fee, step 3 shows invite code with share buttons/creator-events/[id]/matchesas creator — match list, add form, and CSV bulk upload work; non-creators are redirected/oracle/creator-eventsas oracle wallet — stats, pending matches, submit result modal, batch CSV, and recent results all work; non-oracle wallets are redirectedCloses #763
Closes #879
Closes #881
Closes #886