Skip to content

Commit 4e7710b

Browse files
committed
Add prediction market scenes and side menu entry
Prediction Markets in the side menu opens a new list scene: category tabs (sports, crypto, macro, politics) and market cards comparing each venue's best ask, with the best-priced venue highlighted. Tapping a market opens a details scene showing per-venue bid/ask, the merged order book's top levels, and per-venue market metadata with links out. Scenes show a labeled sample dataset when no API key is configured.
1 parent e789cb6 commit 4e7710b

10 files changed

Lines changed: 3175 additions & 0 deletions
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { describe, expect, it } from '@jest/globals'
2+
import { render } from '@testing-library/react-native'
3+
import * as React from 'react'
4+
5+
import { PredictionMarketDetailsScene } from '../../components/scenes/PredictionMarketDetailsScene'
6+
import { predictionMarketSampleData } from '../../plugins/prediction-markets/slipstreamSampleData'
7+
import { FakeProviders } from '../../util/fake/FakeProviders'
8+
import { fakeEdgeAppSceneProps } from '../../util/fake/fakeSceneProps'
9+
10+
describe('PredictionMarketDetailsScene', () => {
11+
it('should render', () => {
12+
const rendered = render(
13+
<FakeProviders>
14+
<PredictionMarketDetailsScene
15+
{...fakeEdgeAppSceneProps('predictionMarketDetails', {
16+
market: predictionMarketSampleData.sports[0]
17+
})}
18+
/>
19+
</FakeProviders>
20+
)
21+
22+
expect(rendered.toJSON()).toMatchSnapshot()
23+
rendered.unmount()
24+
})
25+
})
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { describe, expect, it } from '@jest/globals'
2+
import { render } from '@testing-library/react-native'
3+
import * as React from 'react'
4+
5+
import { PredictionMarketListScene } from '../../components/scenes/PredictionMarketListScene'
6+
import { FakeProviders } from '../../util/fake/FakeProviders'
7+
import { fakeEdgeAppSceneProps } from '../../util/fake/fakeSceneProps'
8+
9+
describe('PredictionMarketListScene', () => {
10+
it('should render', () => {
11+
const rendered = render(
12+
<FakeProviders>
13+
<PredictionMarketListScene
14+
{...fakeEdgeAppSceneProps('predictionMarkets', undefined)}
15+
/>
16+
</FakeProviders>
17+
)
18+
19+
expect(rendered.toJSON()).toMatchSnapshot()
20+
rendered.unmount()
21+
})
22+
})

0 commit comments

Comments
 (0)