diff --git a/wallets/react-wallet-v2/README.md b/wallets/react-wallet-v2/README.md index e53cd62..bcfa31b 100644 --- a/wallets/react-wallet-v2/README.md +++ b/wallets/react-wallet-v2/README.md @@ -68,12 +68,16 @@ url: `/walletconnect` | ----------- | ----------- | | `uri-input` | Uri textbox | | `uri-connect-button` | Uri connect button | +| `qrcode-button` | Use qrcode button | ### Sessions Page url: `/session` | Key | Description | | ----------- | ----------- | -| `session-${topic}` | Session cards can be accessed by topic | +| `session-card` | Session cards can be accessed by topic | +| `session-icon` | Icon used on session card | +| `session-text` | Text listed on session card | +| `session-link` | Link listed on session card | ### Session Details Page url: `/session?topic=` @@ -90,8 +94,11 @@ url: `/pairings` | Key | Description | | ----------- | ----------- | | `pairing-${topic}` | Pairing cards can be accessed by topic | +| `pairing-text-${topic}` | Pairing card text in label | +| `pairing-url-${topic}` | Pairing card link in label| | `pairing-delete-${topic}` | Delete pairing by topic | + ### Accounts Page url: `/` | Key | Description | @@ -99,4 +106,34 @@ url: `/` | `account-picker` | Account drop down selector| | `chain-card-${chain id}` | Chain card by chain id | | `chain-switch-button-${chain id}` | Chain switch button | -| `chain-switch-button-${chain id}` | Chain copy button | \ No newline at end of file +| `chain-switch-button-${chain id}` | Chain copy button | + +### Settings Page +url: `/settings` +| Key | Description | +| ----------- | ----------- | +| `settings-toggle-testnets` | Toggle testnet support on/off | +| `settings-region-select` | Select relayer region | + +### Session Proposal View +| Key | Description | +| ----------- | ----------- | +| `session-approve-button` | Session approve button | +| `session-reject-button` | Session reject button | +| `session-info-card-text` | Session text info in header | +| `session-info-card-url` | Session info url in header | +| `session-info-card-verify` | Session info verify api in header | +| `session-proposal-card-req-{chain}` | Session card for each required chain | +| `session-proposal-card-opt-{chain}` | Session card for each optional chain | +| `account-select-card-${req/opt}-${index}` | Account selection checkbox by account index| +| `account-select-text-${req/opt}-${index}` | Account selection text by account index | + + +### Sign Request View +| Key | Description | +| ----------- | ----------- | +| `request-details-chain` | List of chains in the request | +| `request-details-relay-protocol` | Protocol used for request | +| `request-methods` | Methods requested | +| `request-button-reject` | Reject button | +| `request-button-approve` | Approve button | \ No newline at end of file diff --git a/wallets/react-wallet-v2/src/components/AccountSelectCard.tsx b/wallets/react-wallet-v2/src/components/AccountSelectCard.tsx index dcdff4b..1cedf60 100644 --- a/wallets/react-wallet-v2/src/components/AccountSelectCard.tsx +++ b/wallets/react-wallet-v2/src/components/AccountSelectCard.tsx @@ -9,12 +9,13 @@ interface IProps { index: number selected: boolean onSelect: () => void + isRequired: boolean } /** * Component */ -export default function AccountSelectCard({ address, selected, index, onSelect }: IProps) { +export default function AccountSelectCard({ address, selected, index, onSelect, isRequired }: IProps) { return ( - - + + - {`${truncate(address, 14)} - Account ${index + 1}`} + + {`${truncate(address, 14)} - Account ${index + 1}`} + ) diff --git a/wallets/react-wallet-v2/src/components/PairingCard.tsx b/wallets/react-wallet-v2/src/components/PairingCard.tsx index ad3d985..fff22e0 100644 --- a/wallets/react-wallet-v2/src/components/PairingCard.tsx +++ b/wallets/react-wallet-v2/src/components/PairingCard.tsx @@ -37,11 +37,13 @@ export default function PairingCard({ logo, name, url, topic, onDelete }: IProps >
- + {name} - {truncate(url?.split('https://')[1] ?? 'Unknown', 23)} + + {truncate(url?.split('https://')[1] ?? 'Unknown', 23)} +
diff --git a/wallets/react-wallet-v2/src/components/ProjectInfoCard.tsx b/wallets/react-wallet-v2/src/components/ProjectInfoCard.tsx index 47917b8..7376dec 100644 --- a/wallets/react-wallet-v2/src/components/ProjectInfoCard.tsx +++ b/wallets/react-wallet-v2/src/components/ProjectInfoCard.tsx @@ -30,10 +30,10 @@ export default function ProjectInfoCard({ metadata }: IProps) { - {name} + {name} - {url} - {validation} + {url} + {validation} diff --git a/wallets/react-wallet-v2/src/components/ProposalSelectSection.tsx b/wallets/react-wallet-v2/src/components/ProposalSelectSection.tsx index 0dcba24..86ea224 100644 --- a/wallets/react-wallet-v2/src/components/ProposalSelectSection.tsx +++ b/wallets/react-wallet-v2/src/components/ProposalSelectSection.tsx @@ -9,6 +9,7 @@ interface IProps { addresses: string[] selectedAddresses: string[] | undefined onSelect: (chain: string, address: string) => void + isRequired: boolean } /** @@ -18,7 +19,8 @@ export default function ProposalSelectSection({ addresses, selectedAddresses, chain, - onSelect + onSelect, + isRequired, }: IProps) { return ( @@ -30,7 +32,8 @@ export default function ProposalSelectSection({ address={address} index={index} onSelect={() => onSelect(chain, address)} - selected={selectedAddresses?.includes(address) ?? false} + selected={selectedAddresses?.includes(address) ?? false} + isRequired={isRequired} /> ))} diff --git a/wallets/react-wallet-v2/src/components/QrReader.tsx b/wallets/react-wallet-v2/src/components/QrReader.tsx index 632d046..323ecb5 100644 --- a/wallets/react-wallet-v2/src/components/QrReader.tsx +++ b/wallets/react-wallet-v2/src/components/QrReader.tsx @@ -67,6 +67,7 @@ export default function QrReader({ onConnect }: IProps) { color="gradient" css={{ marginTop: '$10', width: '100%' }} onClick={onShowScanner} + data-testid="qrcode-button" > Scan QR code diff --git a/wallets/react-wallet-v2/src/components/RelayRegionPicker.tsx b/wallets/react-wallet-v2/src/components/RelayRegionPicker.tsx index 32baccb..98eb08a 100644 --- a/wallets/react-wallet-v2/src/components/RelayRegionPicker.tsx +++ b/wallets/react-wallet-v2/src/components/RelayRegionPicker.tsx @@ -14,6 +14,7 @@ export default function AccountPicker() { value={relayerRegionURL} onChange={e => onSelect(e.currentTarget.value)} aria-label="relayerRegions" + data-testid="setting-region-select" > {REGIONALIZED_RELAYER_ENDPOINTS.map((endpoint, index) => { return ( diff --git a/wallets/react-wallet-v2/src/components/RequestDetalilsCard.tsx b/wallets/react-wallet-v2/src/components/RequestDetalilsCard.tsx index 5c6e519..06bb053 100644 --- a/wallets/react-wallet-v2/src/components/RequestDetalilsCard.tsx +++ b/wallets/react-wallet-v2/src/components/RequestDetalilsCard.tsx @@ -25,7 +25,7 @@ export default function RequestDetailsCard({ chains, protocol }: IProps) { Blockchain(s) - + {chains .map( chain => @@ -48,7 +48,7 @@ export default function RequestDetailsCard({ chains, protocol }: IProps) { Relay Protocol - {protocol} + {protocol} diff --git a/wallets/react-wallet-v2/src/components/RequestMethodCard.tsx b/wallets/react-wallet-v2/src/components/RequestMethodCard.tsx index ee04eff..adb2057 100644 --- a/wallets/react-wallet-v2/src/components/RequestMethodCard.tsx +++ b/wallets/react-wallet-v2/src/components/RequestMethodCard.tsx @@ -15,7 +15,7 @@ export default function RequestMethodCard({ methods }: IProps) { Methods - {methods.map(method => method).join(', ')} + {methods.map(method => method).join(', ')} ) diff --git a/wallets/react-wallet-v2/src/components/SessionCard.tsx b/wallets/react-wallet-v2/src/components/SessionCard.tsx index 861ad8a..bb8b034 100644 --- a/wallets/react-wallet-v2/src/components/SessionCard.tsx +++ b/wallets/react-wallet-v2/src/components/SessionCard.tsx @@ -28,6 +28,7 @@ export default function SessionCard({ logo, name, url, topic }: IProps) { marginBottom: '$6', minHeight: '70px' }} + data-testid={`session-card`} > - session icon + session icon diff --git a/wallets/react-wallet-v2/src/pages/sessions.tsx b/wallets/react-wallet-v2/src/pages/sessions.tsx index 0efa302..567f963 100644 --- a/wallets/react-wallet-v2/src/pages/sessions.tsx +++ b/wallets/react-wallet-v2/src/pages/sessions.tsx @@ -30,7 +30,6 @@ export default function SessionsPage() { name={name} logo={icons[0]} url={url} - data-testid={'session-' + session.topic} /> ) }) diff --git a/wallets/react-wallet-v2/src/pages/settings.tsx b/wallets/react-wallet-v2/src/pages/settings.tsx index 23348de..fc897d2 100644 --- a/wallets/react-wallet-v2/src/pages/settings.tsx +++ b/wallets/react-wallet-v2/src/pages/settings.tsx @@ -51,7 +51,7 @@ export default function SettingsPage() { Testnets - + {testNets ? 'Enabled' : 'Disabled'} diff --git a/wallets/react-wallet-v2/src/views/SessionProposalModal.tsx b/wallets/react-wallet-v2/src/views/SessionProposalModal.tsx index 11e2cae..01ec193 100644 --- a/wallets/react-wallet-v2/src/views/SessionProposalModal.tsx +++ b/wallets/react-wallet-v2/src/views/SessionProposalModal.tsx @@ -130,7 +130,7 @@ export default function SessionProposalModal() { } // Render account selection checkboxes based on chain - function renderAccountSelection(chain: string) { + function renderAccountSelection(chain: string, required: boolean) { if (isEIP155Chain(chain)) { return ( ) } else if (isCosmosChain(chain)) { @@ -147,6 +148,7 @@ export default function SessionProposalModal() { selectedAddresses={selectedAccounts[chain]} onSelect={onSelectAccount} chain={chain} + isRequired={required} /> ) } else if (isSolanaChain(chain)) { @@ -156,6 +158,7 @@ export default function SessionProposalModal() { selectedAddresses={selectedAccounts[chain]} onSelect={onSelectAccount} chain={chain} + isRequired={required} /> ) } else if (isPolkadotChain(chain)) { @@ -165,6 +168,7 @@ export default function SessionProposalModal() { selectedAddresses={selectedAccounts[chain]} onSelect={onSelectAccount} chain={chain} + isRequired={required} /> ) } else if (isNearChain(chain)) { @@ -174,6 +178,7 @@ export default function SessionProposalModal() { selectedAddresses={selectedAccounts[chain]} onSelect={onSelectAccount} chain={chain} + isRequired={required} /> ) } else if (isMultiversxChain(chain)) { @@ -183,6 +188,7 @@ export default function SessionProposalModal() { selectedAddresses={selectedAccounts[chain]} onSelect={onSelectAccount} chain={chain} + isRequired={required} /> ) } else if (isTronChain(chain)) { @@ -192,6 +198,7 @@ export default function SessionProposalModal() { selectedAddresses={selectedAccounts[chain]} onSelect={onSelectAccount} chain={chain} + isRequired={required} /> ) } else if (isTezosChain(chain)) { @@ -201,6 +208,7 @@ export default function SessionProposalModal() { selectedAddresses={selectedAccounts[chain]} onSelect={onSelectAccount} chain={chain} + isRequired={required} /> ) } else if (isKadenaChain(chain)) { @@ -210,6 +218,7 @@ export default function SessionProposalModal() { selectedAddresses={selectedAccounts[chain]} onSelect={onSelectAccount} chain={chain} + isRequired={required} /> ) } @@ -218,7 +227,7 @@ export default function SessionProposalModal() { return ( - + {Object.keys(requiredNamespaces).length != 0 ? Required Namespaces : null} @@ -226,8 +235,8 @@ export default function SessionProposalModal() { return ( {`Review ${chain} permissions`} - - {renderAccountSelection(`required:${chain}`)} + + {renderAccountSelection(`required:${chain}`, true)} ) @@ -241,8 +250,8 @@ export default function SessionProposalModal() { return ( {`Review ${chain} permissions`} - - {renderAccountSelection(`optional:${chain}`)} + + {renderAccountSelection(`optional:${chain}`, false)} ) @@ -250,7 +259,7 @@ export default function SessionProposalModal() { - @@ -261,6 +270,7 @@ export default function SessionProposalModal() { onPress={onApprove} disabled={!hasSelected} css={{ opacity: hasSelected ? 1 : 0.4 }} + data-testid="session-approve-button" > Approve diff --git a/wallets/react-wallet-v2/src/views/SessionSignModal.tsx b/wallets/react-wallet-v2/src/views/SessionSignModal.tsx index d932da7..4729de4 100644 --- a/wallets/react-wallet-v2/src/views/SessionSignModal.tsx +++ b/wallets/react-wallet-v2/src/views/SessionSignModal.tsx @@ -64,7 +64,7 @@ export default function SessionSignModal() { Message - {message} + {message} @@ -74,10 +74,10 @@ export default function SessionSignModal() { - - diff --git a/wallets/react-wallet-v2/src/views/SessionSignTypedDataModal.tsx b/wallets/react-wallet-v2/src/views/SessionSignTypedDataModal.tsx index 456ba25..bdf2c30 100644 --- a/wallets/react-wallet-v2/src/views/SessionSignTypedDataModal.tsx +++ b/wallets/react-wallet-v2/src/views/SessionSignTypedDataModal.tsx @@ -70,10 +70,10 @@ export default function SessionSignTypedDataModal() { - -