Commit 5c9abbe
test(e2e): mock Polymarket endpoints to remove from allowlist (MMQA-1800)
The wallet's Explore tab (TrendingView / usePredictMarketData) fetches
data from gamma-api.polymarket.com and other Polymarket hosts when
rendered. Many specs pass through Explore on the way to the browser
via navigateToBrowserView() — Explore → Trending → Browser — so
Polymarket calls fire across many specs that aren't predict-related.
Adds minimal-safe default mocks for the endpoints fired during Explore
render (events/pagination, public-search, events/{id}, markets, parent
events, homepage/carousel, crypto-price, data-api positions/activity/
upnl). Response shapes match the consumer's expected payload (e.g.
events/pagination returns { data: [] } since the consumer reads
data?.data).
Predict and trending specs already register POLYMARKET_COMPLETE_MOCKS
as testSpecificMock at higher priority, so their flows are unaffected
by these defaults.
Removes both Polymarket entries from ALLOWLISTED_HOSTS:
- gamma-api.polymarket.com (was redundant — covered by the wildcard)
- *.polymarket.com (covered all subdomains + apex)
clob.polymarket.com is not in defaults because it only fires on trade
actions, not Explore render. If CI surfaces leakage, follow up.
ALLOWLISTED_HOSTS is now down to 5 entries (4 local + metamask.github.io).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent aac019d commit 5c9abbe
2 files changed
Lines changed: 74 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
| |||
Lines changed: 74 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
3 | 12 | | |
4 | 13 | | |
5 | 14 | | |
| |||
13 | 22 | | |
14 | 23 | | |
15 | 24 | | |
16 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
17 | 89 | | |
18 | 90 | | |
19 | 91 | | |
| |||
0 commit comments