Skip to content

feat(predict): add NBA support to sports predictions#24955

Merged
matallui merged 1 commit into
mainfrom
predict/nba-league
Jan 20, 2026
Merged

feat(predict): add NBA support to sports predictions#24955
matallui merged 1 commit into
mainfrom
predict/nba-league

Conversation

@caieu
Copy link
Copy Markdown
Contributor

@caieu caieu commented Jan 20, 2026

Description

  • Add 'nba' to PredictSportsLeague type union
  • Add NBA slug pattern for game parsing (nba-{away}-{home}-{date})
  • Include 'nba' in SUPPORTED_SPORTS_LEAGUES constant
  • Generalize PredictMarket to render sport cards for any game with a league
  • Remove NFL-specific getNflTeam method in favor of generic getTeam
  • Update TeamsCache tests to reflect removed method

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Expands sports support and simplifies league-specific logic.

  • Adds nba to PredictSportsLeague and SUPPORTED_SPORTS_LEAGUES; introduces NBA_SLUG_PATTERN and updates LEAGUE_SLUG_PATTERNS in utils/gameParser.ts
  • Generalizes PredictMarket to render PredictMarketSportCard for any market.game (not just nfl)
  • Removes getNflTeam from TeamsCache in favor of generic getTeam; updates TeamsCache.test.ts accordingly

Written by Cursor Bugbot for commit 6f465aa. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-predict Predict team label Jan 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePredictions
  • Risk Level: low
  • AI Confidence: 95%
click to see 🤖 AI reasoning details

The changes are entirely contained within the Predict feature (app/components/UI/Predict/) and add NBA support to the existing sports predictions functionality. Specifically:

  1. PredictMarket.tsx - Broadens the condition to show sports cards for any game (not just NFL)
  2. sports.ts - Adds 'nba' to supported leagues array
  3. TeamsCache.ts - Removes NFL-specific convenience method in favor of generic getTeam()
  4. TeamsCache.test.ts - Removes tests for deleted method
  5. types/index.ts - Extends PredictSportsLeague type to include 'nba'
  6. gameParser.ts - Adds NBA slug pattern for parsing

These changes:

  • Don't touch any core wallet functionality, navigation, or shared components
  • Are isolated to the Predict feature module
  • Have dedicated E2E tests under e2e/specs/predict/ using SmokePredictions tag
  • Include unit test updates for the removed method

The SmokePredictions tag is the appropriate and only necessary tag to run, as it covers all prediction market E2E tests that would validate this feature expansion.

View GitHub Actions results

@caieu caieu marked this pull request as ready for review January 20, 2026 21:41
@caieu caieu requested a review from a team as a code owner January 20, 2026 21:41
@sonarqubecloud
Copy link
Copy Markdown

@matallui matallui added this pull request to the merge queue Jan 20, 2026
Merged via the queue into main with commit eb7e457 Jan 20, 2026
101 checks passed
@matallui matallui deleted the predict/nba-league branch January 20, 2026 23:32
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 20, 2026
@metamaskbot metamaskbot added the release-7.63.0 Issue or pull request that will be included in release 7.63.0 label Jan 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.63.0 Issue or pull request that will be included in release 7.63.0 size-S team-predict Predict team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants