Skip to content

fix(PrizePool): isolate team template mock per test#7795

Merged
Rathoz merged 2 commits into
mainfrom
fix-prizepool-tests
Jul 9, 2026
Merged

fix(PrizePool): isolate team template mock per test#7795
Rathoz merged 2 commits into
mainfrom
fix-prizepool-tests

Conversation

@Eetwalt

@Eetwalt Eetwalt commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Set up/tear down the TeamTemplate mock in before_each/after_each so every test in the spec resolves team templates against mock data
  • Fixes an order-dependent CI failure: TeamTemplate.getRawOrNil is memoized at module scope (perf: Memoize TeamTemplate.getRawOrNil #7777), so a team resolved while the mock was inactive cached a nil result that leaked into the later "USD player share" test, tripping Invalid team template: mouz
  • Removed the now-redundant inline mock setup from that test

How did you test this change?

CI

Copilot AI review requested due to automatic review settings July 9, 2026 11:14
@Eetwalt Eetwalt requested a review from a team as a code owner July 9, 2026 11:14
@Eetwalt Eetwalt requested a review from a team as a code owner July 9, 2026 11:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR stabilizes the PrizePool spec by ensuring the TeamTemplate extension is consistently mocked in every test, preventing order-dependent failures introduced by memoization of TeamTemplate.getRawOrNil.

Changes:

  • Add a module-level TeamTemplateMock require and set it up in before_each.
  • Tear down the TeamTemplate mock in after_each to avoid cross-test leakage.
  • Remove redundant per-test mock setup/teardown from the “USD player share” test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Rathoz Rathoz merged commit 3587c11 into main Jul 9, 2026
@Rathoz Rathoz deleted the fix-prizepool-tests branch July 9, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants