-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathPredict.testIds.ts
More file actions
280 lines (226 loc) · 9.43 KB
/
Predict.testIds.ts
File metadata and controls
280 lines (226 loc) · 9.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
import enContent from '../../../../locales/languages/en.json';
// ========================================
// PREDICT TAB VIEW SELECTORS
// ========================================
export const PredictTabViewSelectorsIDs = {
// Main container
CONTAINER: 'predict-tab-view-container',
// Scroll view
SCROLL_VIEW: 'predict-tab-view-scroll-view',
// FlashList
FLASH_LIST: 'predict-tab-view-flash-list',
} as const;
// ========================================
// PREDICT MARKET LIST SELECTORS
// ========================================
export const PredictMarketListSelectorsIDs = {
// Main container
CONTAINER: 'predict-market-list-container',
// Categories/Tabs
CATEGORY_TABS: 'predict-market-list-category-tabs',
TRENDING_TAB: 'predict-market-list-trending-tab',
NEW_TAB: 'predict-market-list-new-tab',
SPORTS_TAB: 'predict-market-list-sports-tab',
CRYPTO_TAB: 'predict-market-list-crypto-tab',
POLITICS_TAB: 'predict-market-list-politics-tab',
BACK_BUTTON: 'back-button',
// Empty state
EMPTY_STATE: 'predict-market-list-empty-state',
} as const;
// Helper functions for dynamic market list selectors
export const getPredictMarketListSelector = {
marketCardByCategory: (category: string, index: number) =>
`predict-market-list-${category}-card-${index}`,
emptyState: () => 'predict-market-list-empty-state',
};
// ========================================
// PREDICT FEED SELECTORS
// ========================================
export const PredictFeedSelectorsIDs = {
TABS: 'predict-feed-tabs',
PAGER: 'predict-feed-pager',
} as const;
export const getPredictFeedSelector = {
tabPage: (key: string) => `predict-feed-tab-page-${key}`,
emptyState: (category: string) => `predict-empty-state-${category}`,
skeletonLoading: (category: string, index: number) =>
`skeleton-loading-${category}-${index}`,
skeletonFooter: (category: string, index: number) =>
`skeleton-footer-${category}-${index}`,
searchSkeleton: (index: number) => `search-skeleton-${index}`,
marketList: (category: string) => `predict-market-list-${category}`,
};
// PredictFeed unit test mock selectors (used by PredictFeed.test.tsx mocks)
export const PredictFeedMockSelectorsIDs = {
PAGER_VIEW: 'pager-view-mock',
BALANCE_MOCK: 'predict-balance-mock',
OFFLINE_MOCK: 'predict-offline-mock',
} as const;
export const getPredictFeedMockSelector = {
tabKey: (key: string) => `tab-${key}`,
activeTab: (index: number) => `active-tab-${index}`,
pagerPage: (index: number) => `pager-page-${index}`,
};
// ========================================
// PREDICT MARKET DETAILS SELECTORS
// ========================================
export type PredictMarketDetailsTabKey = 'positions' | 'outcomes' | 'about';
const PREDICT_MARKET_DETAILS_SELECTOR_BASE = 'predict-market-details';
export const getPredictMarketDetailsSelector = {
tabBar: `${PREDICT_MARKET_DETAILS_SELECTOR_BASE}-tab-bar`,
tabContent: (tabKey: PredictMarketDetailsTabKey) =>
`${PREDICT_MARKET_DETAILS_SELECTOR_BASE}-${tabKey}-tab-content`,
tabBarTab: (tabKey: PredictMarketDetailsTabKey) =>
`${PREDICT_MARKET_DETAILS_SELECTOR_BASE}-tab-bar-tab-${tabKey}`,
icon: (name: string) => `icon-${name}`,
} as const;
export const PredictMarketDetailsSelectorsIDs = {
// Main screen
SCREEN: 'predict-market-details-screen',
SCROLLABLE_TAB_VIEW: 'predict-market-details-scrollable-tab-view',
// Header
BACK_BUTTON: 'predict-market-details-back-button',
SHARE_BUTTON: 'predict-market-details-share-button',
// Tabs
TAB_BAR: getPredictMarketDetailsSelector.tabBar,
ABOUT_TAB: getPredictMarketDetailsSelector.tabBarTab('about'),
POSITIONS_TAB: getPredictMarketDetailsSelector.tabBarTab('positions'),
OUTCOMES_TAB: getPredictMarketDetailsSelector.tabBarTab('outcomes'),
// Tab content containers
ABOUT_TAB_CONTENT: getPredictMarketDetailsSelector.tabContent('about'),
POSITIONS_TAB_CONTENT:
getPredictMarketDetailsSelector.tabContent('positions'),
OUTCOMES_TAB_CONTENT: getPredictMarketDetailsSelector.tabContent('outcomes'),
MARKET_DETAILS_CASH_OUT_BUTTON: 'predict-market-details-cash-out-button',
CLAIM_WINNINGS_BUTTON: 'predict-market-details-claim-winnings-button',
// Chart and content (used by component and tests)
DETAILS_CHART: 'predict-details-chart',
GAME_DETAILS_CONTENT: 'predict-game-details-content',
// Skeleton loaders
DETAILS_HEADER_SKELETON_BACK_BUTTON:
'predict-details-header-skeleton-back-button',
DETAILS_CONTENT_SKELETON_LINE_1: 'predict-details-content-skeleton-line-1',
DETAILS_BUTTONS_SKELETON_BUTTON_1:
'predict-details-buttons-skeleton-button-1',
// BottomSheet wrappers
BUY_PREVIEW_SHEET: 'predict-buy-preview-sheet',
SELL_PREVIEW_SHEET: 'predict-sell-preview-sheet',
} as const;
// ========================================
// PREDICT CRYPTO UP/DOWN DETAILS SELECTORS
// ========================================
export const PredictCryptoUpDownDetailsSelectorsIDs = {
SCREEN: 'predict-crypto-up-down-details-screen',
HEADER: 'predict-crypto-up-down-details-header',
BACK_BUTTON: 'predict-crypto-up-down-details-back-button',
SHARE_BUTTON: 'predict-crypto-up-down-details-share-button',
SCROLL_VIEW: 'predict-crypto-up-down-details-scroll-view',
TITLE_SECTION: 'predict-crypto-up-down-details-title-section',
} as const;
export const PredictMarketDetailsSelectorsText = {
// Tab content containers
ABOUT_TAB_TEXT: 'About',
POSITIONS_TAB_TEXT: 'Positions',
OUTCOMES_TAB_TEXT: 'Outcomes',
} as const;
// ========================================
// PREDICT POSITIONS HEADER SELECTORS
// ========================================
export const PredictPositionsHeaderSelectorsIDs = {
// Claim button
CLAIM_BUTTON: 'predict-claim-button',
} as const;
// ========================================
// PREDICT POSITIONS SELECTORS
// ========================================
export const PredictPositionsSelectorsIDs = {
// Lists
ACTIVE_POSITIONS_LIST: 'predict-active-positions-list',
CLAIMABLE_POSITIONS_LIST: 'predict-claimable-positions-list',
// Section headers
RESOLVED_MARKETS_HEADER: 'predict-resolved-markets-header',
} as const;
// Predict position selectors
export const PredictPositionSelectorsIDs = {
CURRENT_POSITION_CARD: 'predict-current-position-card',
RESOLVED_POSITION_CARD: 'predict-resolved-position-card',
} as const;
// ========================================
// PREDICT BUY PREVIEW SELECTORS
// ========================================
export const PredictBuyPreviewSelectorsIDs = {
// Buy/Place bet button
PLACE_BET_BUTTON: 'predict-buy-preview-place-bet-button',
// Inline error banners (sheet mode)
PRICE_CHANGED_BANNER: 'predict-buy-preview-price-changed-banner',
ORDER_FAILED_BANNER: 'predict-buy-preview-order-failed-banner',
} as const;
// ========================================
// PREDICT CASH OUT SELECTORS
// ========================================
export const PredictCashOutSelectorsIDs = {
// Container
CONTAINER: 'predict-cash-out-container',
// Cash out buttons
SELL_PREVIEW_CASH_OUT_BUTTON: 'predict-sell-preview-cash-out-button',
} as const;
export const PredictOrderRetrySheetSelectorsIDs = {
CONTAINER: 'predict-order-retry-sheet-container',
RETRY_BUTTON: 'predict-order-retry-sheet-retry-button',
CLOSE_BUTTON: 'predict-order-retry-sheet-close-button',
} as const;
// ========================================
// PREDICT CLAIM CONFIRMATION SELECTORS
// ========================================
export const PredictClaimConfirmationSelectorsIDs = {
// Claim amount container
CLAIM_BACKGROUND_CONTAINER: 'predict-claim-background',
CLAIM_AMOUNT_CONTAINER: 'predict-claim-amount-container',
// Claim confirm button
CLAIM_CONFIRM_BUTTON: 'predict-claim-confirm-button',
// PREDICT UNAVAILABLE (GEO-BLOCK) SELECTORS
// ========================================
} as const;
export const PredictUnavailableSelectorsIDs = {
TITLE_TEXT: enContent.predict.unavailable.title,
DESCRIPTION_TEXT: enContent.predict.unavailable.description,
LINK_TEXT: enContent.predict.unavailable.link,
BUTTON_TEXT: enContent.predict.unavailable.button,
} as const;
// ========================================
// PREDICT ACTIVITY DETAILS SELECTORS
// ========================================
export const PredictActivityDetailsSelectorsIDs = {
BACK_BUTTON: 'predict-activity-details-back-button',
CONTAINER: 'predict-activity-details-container',
TITLE_TEXT: 'predict-activity-details-title',
AMOUNT_DISPLAY: 'predict-activity-details-amount',
} as const;
// ========================================
// PREDICT SEARCH SELECTORS
// ========================================
export const PredictSearchSelectorsIDs = {
SEARCH_BUTTON: 'predict-search-button',
CLEAR_BUTTON: 'predict-clear-button',
ERROR_STATE: 'predict-error-state',
} as const;
export const getPredictSearchSelector = {
resultCard: (index: number) => `predict-search-result-${index}`,
};
// ========================================
// PREDICT BALANCE SELECTORS
// ========================================
export const PredictBalanceSelectorsIDs = {
BALANCE_CARD: 'predict-balance-card',
WITHDRAW_BUTTON: 'predict-balance-withdraw-button',
} as const;
export const PredictBalanceSelectorsText = {
AVAILABLE_BALANCE: enContent.predict.available_balance,
WITHDRAW: enContent.predict.deposit.withdraw,
} as const;
// ========================================
// PREDICT ADD FUNDS SELECTORS
// ========================================
export const PredictAddFundsSelectorText = {
ADD_FUNDS: enContent.predict.deposit.add_funds,
} as const;