File tree Expand file tree Collapse file tree 9 files changed +25
-6
lines changed
packages/ui/src/components Expand file tree Collapse file tree 9 files changed +25
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @relayprotocol/relay-kit-ui ' : patch
3+ ---
4+
5+ Add test ids for automation
Original file line number Diff line number Diff line change @@ -262,6 +262,7 @@ export const CustomAddressModal: FC<Props> = ({
262262 }
263263 onOpenChange ( false )
264264 } }
265+ data-testid = "save-button"
265266 >
266267 Save
267268 </ Button >
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ type MultiWalletDropdownProps = {
1818 selectedWalletAddress ?: string
1919 chain ?: RelayChain
2020 disablePasteWalletAddressOption ?: boolean
21+ testId ?: string
2122 onSelect : ( wallet : LinkedWallet ) => void
2223 onLinkNewWallet : ( ) => void
2324 onAnalyticEvent ?: ( eventName : string , data ?: any ) => void
@@ -30,6 +31,7 @@ export const MultiWalletDropdown: FC<MultiWalletDropdownProps> = ({
3031 selectedWalletAddress,
3132 chain,
3233 disablePasteWalletAddressOption,
34+ testId,
3335 onSelect,
3436 onAnalyticEvent,
3537 onLinkNewWallet,
@@ -141,6 +143,7 @@ export const MultiWalletDropdown: FC<MultiWalletDropdownProps> = ({
141143 display : 'flex' ,
142144 alignContent : 'center'
143145 } }
146+ data-testid = { testId }
144147 >
145148 < Flex align = "center" css = { { gap : '1' } } >
146149 { isSupportedSelectedWallet && selectedWallet ?. walletLogoUrl ? (
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ export const ChainFilterSidebar: FC<ChainFilterSidebarProps> = ({
131131 < AccessibleListItem value = "input" asChild >
132132 < Input
133133 ref = { onInputRef }
134+ data-testid = "chain-search-input"
134135 placeholder = "Search chains"
135136 icon = {
136137 < Box css = { { color : 'gray9' } } >
Original file line number Diff line number Diff line change @@ -14,15 +14,15 @@ import useRelayClient from '../../../../hooks/useRelayClient.js'
1414type TokenTriggerProps = {
1515 token ?: Token
1616 locked ?: boolean
17- isSingleChainLocked ?: boolean
1817 address ?: string
18+ testId ?: string
1919}
2020
2121export const TokenTrigger : FC < TokenTriggerProps > = ( {
2222 token,
2323 locked,
24- isSingleChainLocked ,
25- address
24+ address ,
25+ testId
2626} ) => {
2727 const relayClient = useRelayClient ( )
2828 const chain = relayClient ?. chains ?. find (
@@ -50,6 +50,7 @@ export const TokenTrigger: FC<TokenTriggerProps> = ({
5050 backgroundColor : 'widget-selector-background'
5151 }
5252 } }
53+ data-testid = { testId }
5354 >
5455 < Flex align = "center" css = { { gap : '2' } } >
5556 < ChainTokenIcon
Original file line number Diff line number Diff line change @@ -125,6 +125,7 @@ export const TransactionsByChain: FC<TransactionsByChainProps> = ({
125125 alignItems : 'center' ,
126126 gap : '2'
127127 } }
128+ data-testid = "transaction-link"
128129 >
129130 { truncateAddress ( txHash ) }
130131 < FontAwesomeIcon
@@ -148,6 +149,7 @@ export const TransactionsByChain: FC<TransactionsByChainProps> = ({
148149 alignItems : 'center' ,
149150 gap : '2'
150151 } }
152+ data-testid = "refund-transaction-link"
151153 >
152154 { truncateAddress ( refundTx ?. txHash ) }
153155 < FontAwesomeIcon icon = { faArrowUpRightFromSquare } width = { 16 } />
Original file line number Diff line number Diff line change @@ -424,8 +424,9 @@ const OnrampWidget: FC<OnrampWidgetProps> = ({
424424 margin : '0 auto' ,
425425 marginBottom : '16px'
426426 } }
427+ data-testid = "onramp-token-select-button"
427428 >
428- < TokenTrigger isSingleChainLocked = { true } token = { token } />
429+ < TokenTrigger token = { token } />
429430 </ div >
430431 }
431432 />
@@ -558,6 +559,7 @@ const OnrampWidget: FC<OnrampWidgetProps> = ({
558559 disablePasteWalletAddressOption = {
559560 disablePasteWalletAddressOption
560561 }
562+ testId = "onramp-wallet-select-button"
561563 />
562564 ) : null }
563565 { ! multiWalletSupportEnabled || ! toChainWalletVMSupported ? (
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ const SwapButton: FC<SwapButtonProps> = ({
7777 isSameCurrencySameRecipientSwap ||
7878 ! recipientWalletSupportsChain ) )
7979 }
80+ data-testid = "swap-button"
8081 onClick = { ( ) => {
8182 onClick ( )
8283 } }
@@ -101,6 +102,7 @@ const SwapButton: FC<SwapButtonProps> = ({
101102 context
102103 } )
103104 } }
105+ data-testid = "widget-connect-wallet-button"
104106 >
105107 Connect Wallet
106108 </ Button >
Original file line number Diff line number Diff line change @@ -791,6 +791,7 @@ const SwapWidget: FC<SwapWidgetProps> = ({
791791 setAddressModalOpen = { setAddressModalOpen }
792792 wallets = { linkedWallets ! }
793793 onAnalyticEvent = { onAnalyticEvent }
794+ testId = "origin-wallet-select-button"
794795 />
795796 ) : null }
796797 </ Flex >
@@ -899,8 +900,8 @@ const SwapWidget: FC<SwapWidgetProps> = ({
899900 < TokenTrigger
900901 token = { fromToken }
901902 locked = { lockFromToken }
902- isSingleChainLocked = { isSingleChainLocked }
903903 address = { address }
904+ testId = "origin-token-select-button"
904905 />
905906 </ div >
906907 }
@@ -1274,6 +1275,7 @@ const SwapWidget: FC<SwapWidgetProps> = ({
12741275 setAddressModalOpen = { setAddressModalOpen }
12751276 wallets = { linkedWallets ! }
12761277 onAnalyticEvent = { onAnalyticEvent }
1278+ testId = "destination-wallet-select-button"
12771279 />
12781280 ) : null }
12791281
@@ -1420,8 +1422,8 @@ const SwapWidget: FC<SwapWidgetProps> = ({
14201422 < TokenTrigger
14211423 token = { toToken }
14221424 locked = { lockToToken }
1423- isSingleChainLocked = { isSingleChainLocked }
14241425 address = { address }
1426+ testId = "destination-token-select-button"
14251427 />
14261428 </ div >
14271429 }
You can’t perform that action at this time.
0 commit comments