Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added DataTestIdsEnum #303

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
TRANSACTIONS_ENDPOINT,
useGetNetworkConfig
} from 'lib';
import { DataTestIdsEnum } from 'localConstants';
import { SignedTransactionType } from 'types';

export const TransactionOutput = ({
Expand Down Expand Up @@ -44,7 +45,7 @@ export const TransactionOutput = ({
value={transaction.value}
showLabel={transaction.value !== '0'}
egldLabel={network.egldLabel}
data-testid='balance'
data-testid={DataTestIdsEnum.balance}
/>
</p>
<p>
Expand Down
20 changes: 20 additions & 0 deletions src/localConstants/dataTestIds.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export enum DataTestIdsEnum {
balance = 'balance',
heroTag = 'heroTag',
nftExplorerLink = 'nftExplorerLink',
nftFormattedAmount = 'nftFormattedAmount',
receiverLink = 'receiverLink',
receiverShard = 'receiverShard',
senderLink = 'senderLink',
senderShard = 'senderShard',
shardFromLink = 'shardFromLink',
shardToLink = 'shardToLink',
tokenExplorerLink = 'tokenExplorerLink',
tokenFormattedAmount = 'tokenFormattedAmount',
transactionHash = 'transactionHash',
transactionLink = 'transactionLink',
transactionMethod = 'transactionMethod',
transactionReceiver = 'transactionReceiver',
transactionSender = 'transactionSender',
transactionValue = 'transactionValue'
}
1 change: 1 addition & 0 deletions src/localConstants/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './dataTestIds.enum';
export * from './routes';
export * from './session';
export * from './signMessage';
3 changes: 2 additions & 1 deletion src/pages/Dashboard/widgets/Account/Account.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Label, OutputContainer } from 'components';
import { FormatAmount, useGetAccountInfo, useGetNetworkConfig } from 'lib';
import { DataTestIdsEnum } from 'localConstants';
import { Username } from './components';

export const Account = () => {
Expand All @@ -24,7 +25,7 @@ export const Account = () => {
<FormatAmount
value={account.balance}
egldLabel={network.egldLabel}
data-testid='balance'
data-testid={DataTestIdsEnum.balance}
/>
</p>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/pages/Dashboard/widgets/Account/components/Username.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { AccountType } from '@multiversx/sdk-dapp/types';
import { Label } from 'components';
import { trimUsernameDomain } from 'lib';
import { DataTestIdsEnum } from 'localConstants';
import { ProfileType } from 'types';

export const Username = (props: {
Expand All @@ -15,7 +16,7 @@ export const Username = (props: {
return (
<p>
<Label>Herotag: </Label>
<span daata-testid='heroTag'>
<span data-testid={DataTestIdsEnum.heroTag}>
{account.username ? trimUsernameDomain(account.username) : 'N/A'}
</span>
</p>
Expand Down
Loading