Skip to content

Commit

Permalink
♻️replace data-test-id by data-testid
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasWerey committed Jul 25, 2024
1 parent 58c4bee commit f6a607d
Show file tree
Hide file tree
Showing 211 changed files with 350 additions and 372 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function BalanceTotal({
showCode
val={totalBalance}
dynamicSignificantDigits={dynamicSignificantDigits}
data-test-id="total-balance"
data-testid="total-balance"
/>
)}
{withTransactionsPendingConfirmationWarning ? (
Expand Down Expand Up @@ -160,11 +160,11 @@ export default function BalanceInfos({ totalBalance, valueChange, isAvailable, u

{!portfolioExchangeBanner?.enabled && (
<>
<Button data-test-id="portfolio-buy-button" variant="color" mr={1} onClick={onBuy}>
<Button data-testid="portfolio-buy-button" variant="color" mr={1} onClick={onBuy}>
{t("accounts.contextMenu.buy")}
</Button>
<Button
data-test-id="portfolio-swap-button"
data-testid="portfolio-swap-button"
variant="color"
event="button_clicked2"
eventProperties={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const Rotating = styled(Box)<{
`;
export default function BigSpinner({ size, ...props }: { size: number; isRotating?: boolean }) {
return (
<Rotating size={size} data-test-id="big-loading-spinner" {...props}>
<Rotating size={size} data-testid="big-loading-spinner" {...props}>
<IconBigSpinner size={size} />
</Rotating>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function Button({
{...rest}
disabled={disabled}
onClick={isClickDisabled ? undefined : onClickHandler}
data-test-id={buttonTestId}
data-testid={buttonTestId}
ref={null}
>
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ const Carousel = ({

return (
<CarouselWrapper
data-test-id="carousel"
data-testid="carousel"
onMouseEnter={() => setPaused(true)}
onMouseLeave={() => setPaused(false)}
>
Expand All @@ -234,7 +234,7 @@ const Carousel = ({
);
})}
</Slides>
<Close data-test-id="carousel-close-button" onClick={onDismiss}>
<Close data-testid="carousel-close-button" onClick={onDismiss}>
<IconCross size={16} />
</Close>
{showControls ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const DeviceLanguageInstalled = ({ language }: { language: Language }) => {
flexDirection="column"
alignItems="center"
justifyContent="center"
data-test-id="language-installed"
data-testid="language-installed"
>
<BoxedIcon
Icon={IconsLegacy.CheckAloneMedium}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,7 @@ const ChangeDeviceLanguagePrompt: React.FC<Props> = ({
>
<Flex flex={1} />
<Button onClick={onSkip}>{t("deviceLocalization.dontChangeLanguage")}</Button>
<Button
data-test-id="install-language-button"
ml={4}
variant="main"
onClick={onConfirm}
>
<Button data-testid="install-language-button" ml={4} variant="main" onClick={onConfirm}>
{t("deviceLocalization.changeLanguage")}
</Button>
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export default function Chart({
}
}, [generateOptions, generatedData, valueKey]);
return (
<ChartContainer height={height} data-test-id="chart-container">
<ChartContainer height={height} data-testid="chart-container">
<canvas ref={canvasRef} />
{tooltip && renderTooltip ? (
<Tooltip tooltip={tooltip} renderTooltip={renderTooltip} color={color} data={data} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const ActionCard = ({ img, leftContent, title, description, actions, onView }: P
<Link
size="small"
onClick={() => actions.dismiss.action()}
data-test-id={actions.dismiss.dataTestId}
data-testid={actions.dismiss.dataTestId}
>
{actions.dismiss.label}
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class ContextMenuWrapper extends PureComponent<Props, State> {
if (callback) callback(e);
this.hideContextMenu();
}}
data-test-id={`accounts-context-menu-${label.split(".").pop()}`}
data-testid={`accounts-context-menu-${label.split(".").pop()}`}
>
<Box horizontal>
{Icon && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ContrastChoice: React.FC<Props> = ({ selected, color, onClick, index }) =>
<Container
selected={selected}
onClick={onClick}
data-test-id={`custom-image-contrast-option-${index}-button`}
data-testid={`custom-image-contrast-option-${index}-button`}
>
<ContrastOption colors={color} />
</Container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const RenderImageLoadRequested = ({
flexDirection="column"
justifyContent="center"
alignItems="center"
data-test-id="device-action-image-load-requested"
data-testid="device-action-image-load-requested"
>
<DeviceBlocker />
<AnimationWrapper>
Expand Down Expand Up @@ -64,7 +64,7 @@ export const RenderLoadingImage = ({
flexDirection="column"
justifyContent="center"
alignItems="center"
data-test-id={`device-action-image-loading-${progress}`}
data-testid={`device-action-image-loading-${progress}`}
>
<AnimationWrapper>
<FramedPicture
Expand Down Expand Up @@ -109,7 +109,7 @@ export const RenderImageCommitRequested = ({
flexDirection="column"
justifyContent="center"
alignItems="center"
data-test-id="device-action-image-commit-requested"
data-testid="device-action-image-commit-requested"
>
<DeviceBlocker />
<AnimationWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ const ImageCropper: React.FC<Props> = props => {

return (
<Flex flexDirection="column" justifyContent="center" alignItems="center">
<Flex position="relative" height={330} width={330} data-test-id="custom-image-crop-view">
<Flex position="relative" height={330} width={330} data-testid="custom-image-crop-view">
<img
src={imageBase64DataUri}
ref={imageRef}
Expand Down Expand Up @@ -265,7 +265,7 @@ const ImageCropper: React.FC<Props> = props => {
backgroundColor="transparent"
onClick={rotateCounterClockwise}
Icon={IconsLegacy.ReverseMedium}
data-test-id="custom-image-crop-rotate-button"
data-testid="custom-image-crop-rotate-button"
>
Rotate
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const ImportButton: React.FC<Props> = props => {
const { colors } = useTheme();

return (
<Container bg={colors.opacityDefault.c05} onClick={onClick} data-test-id={testId}>
<Container bg={colors.opacityDefault.c05} onClick={onClick} data-testid={testId}>
<Text variant="large" fontWeight="semiBold">
{text}
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ const ImportImage: React.FC<Props> = ({ setLoading, onResult, onError, onClick }
<ImportButton
text={t("customImage.steps.choose.upload")}
Icon={IconsLegacy.UploadMedium}
data-test-id="custom-image-import-image-button"
data-testid="custom-image-import-image-button"
onClick={onClick}
>
<ImageInput onChange={onChange} data-test-id="custom-image-import-image-input" />
<ImageInput onChange={onChange} data-testid="custom-image-import-image-input" />
</ImportButton>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ const NftItem = ({ id, onItemClick, selected, testId, index }: Props) => {
selected={selected}
className={show || process.env.ALWAYS_SHOW_SKELETONS ? "disabled" : ""}
onClick={handleClick}
data-test-id={testId}
data-testid={testId}
>
<Flex flex={1} width="100%" data-test-id={`custom-image-nft-card-media-${index}`}>
<Flex flex={1} width="100%" data-testid={`custom-image-nft-card-media-${index}`}>
<Skeleton width={40} minHeight={40} full={isGrid} show={show}>
<Media
metadata={metadata as NFTMetadata}
Expand All @@ -99,15 +99,15 @@ const NftItem = ({ id, onItemClick, selected, testId, index }: Props) => {
<EllipsizedText
variant="small"
fontWeight="medium"
data-test-id={`custom-image-nft-card-name-${index}`}
data-testid={`custom-image-nft-card-name-${index}`}
>
{nftName || "-"}
</EllipsizedText>
<EllipsizedText
variant="small"
fontWeight="medium"
color="neutral.c60"
data-test-id={`custom-image-nft-card-id-${index}`}
data-testid={`custom-image-nft-card-id-${index}`}
>
<Trans i18nKey="NFT.gallery.tokensList.item.tokenId" values={{ tokenId: nft.tokenId }} />
</EllipsizedText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,12 @@ const ValidatorRow = ({
disabled={!value && disabled}
active={!!value}
onClick={onRowClick}
data-test-id="modal-provider-row"
data-testid="modal-provider-row"
>
{icon}
<InfoContainer>
<Title onClick={onTitleClick}>
<Text data-test-id="modal-provider-title">{title}</Text>
<Text data-testid="modal-provider-title">{title}</Text>
<IconContainer>
<ExternalLink size={16} />
</IconContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ export const InstallingApp = ({
track("In-line app install", { appName: appNameToTrack, flow: analyticsPropertyFlow });
}, [appNameToTrack, analyticsPropertyFlow]);
return (
<Wrapper data-test-id="device-action-loader">
<Wrapper data-testid="device-action-loader">
<Header />
<AnimationWrapper>
<Animation animation={getDeviceAnimation(modelId, type, "installLoading")} />
Expand All @@ -433,7 +433,7 @@ export const renderInstallingLanguage = ({ progress, t }: { progress: number; t:
alignItems="center"
justifyContent="center"
flexDirection="column"
data-test-id="installing-language-progress"
data-testid="installing-language-progress"
>
<Box my={5} alignItems="center">
<Flex alignItems="center" justifyContent="center" borderRadius={9999} size={60} mb={5}>
Expand All @@ -451,7 +451,7 @@ export const renderInstallingLanguage = ({ progress, t }: { progress: number; t:
};

export const renderListingApps = () => (
<Wrapper data-test-id="device-action-loader">
<Wrapper data-testid="device-action-loader">
<Header />
<ProgressWrapper>
<Rotating size={58}>
Expand Down Expand Up @@ -513,7 +513,7 @@ export const renderAllowLanguageInstallation = ({
flexDirection="column"
justifyContent="center"
alignItems="center"
data-test-id="allow-language-installation"
data-testid="allow-language-installation"
>
<DeviceBlocker />
<AnimationWrapper>
Expand Down Expand Up @@ -1112,7 +1112,7 @@ export const renderSwapDeviceConfirmation = ({
</Alert>
</Box>

<DeviceSwapSummaryStyled data-test-id="device-swap-summary">
<DeviceSwapSummaryStyled data-testid="device-swap-summary">
{deviceSwapSummaryFields.map(([key, value]) => (
<Fragment key={key}>
<Text fontWeight="medium" color="palette.text.shade40" fontSize="14px">
Expand Down Expand Up @@ -1157,7 +1157,7 @@ export const renderSecureTransferDeviceConfirmation = ({
);

export const renderLoading = ({ children }: { children?: React.ReactNode } = {}) => (
<Wrapper data-test-id="device-action-loader">
<Wrapper data-testid="device-action-loader">
<Header />
<Flex alignItems="center" justifyContent="center" borderRadius={9999} size={60} mb={5}>
<InfiniteLoader size={58} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default function EarnRewardsInfoModal<Name extends keyof ModalData>({
<Button ml={2} secondary onClick={onClose}>
<Trans i18nKey="common.cancel" />
</Button>
<Button ml={2} primary onClick={onNextFn} data-test-id="modal-continue-button">
<Button ml={2} primary onClick={onNextFn} data-testid="modal-continue-button">
{nextLabel || <Trans i18nKey="common.continue" />}
</Button>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const EntryButton: React.FC<EntryButtonProps> = ({
entryButtonTestId,
}) => {
return (
<EntryButtonContainer onClick={onClick} disabled={disabled} data-test-id={entryButtonTestId}>
<EntryButtonContainer onClick={onClick} disabled={disabled} data-testid={entryButtonTestId}>
<Box horizontal shrink alignItems="center">
{Icon && (
<IconWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default function IsUnlocked({ children }: { children: React.ReactNode }):
}, [isLocked]);
if (isLocked) {
return (
<Box sticky alignItems="center" justifyContent="center" data-test-id="lockscreen-container">
<Box sticky alignItems="center" justifyContent="center" data-testid="lockscreen-container">
<form onSubmit={handleSubmit}>
<Box alignItems="center">
<LedgerLiveLogo
Expand All @@ -132,7 +132,7 @@ export default function IsUnlocked({ children }: { children: React.ReactNode }):
value={inputValue.password}
error={incorrectPassword}
id="lockscreen-password-input"
data-test-id="lockscreen-password-input"
data-testid="lockscreen-password-input"
/>
</Box>
<Box ml={2}>
Expand All @@ -146,7 +146,7 @@ export default function IsUnlocked({ children }: { children: React.ReactNode }):
padding: 0,
justifyContent: "center",
}}
data-test-id="lockscreen-login-button"
data-testid="lockscreen-login-button"
>
<Box alignItems="center">
<IconArrowRight size={20} />
Expand All @@ -159,7 +159,7 @@ export default function IsUnlocked({ children }: { children: React.ReactNode }):
mt={3}
small
onClick={handleOpenHardResetModal}
data-test-id="lockscreen-forgotten-button"
data-testid="lockscreen-forgotten-button"
>
{t("common.lockScreen.lostPassword")}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class LedgerLiveLogo extends PureComponent<Props> {
render() {
const { icon, ...p } = this.props;
return (
<LiveLogoContainer {...p} data-test-id="logo">
<LiveLogoContainer {...p} data-testid="logo">
{icon}
</LiveLogoContainer>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,7 @@ export const LiveAppDrawer = () => {
cursor: "pointer",
}}
>
<CheckBox
isChecked={dismissDisclaimerChecked}
data-test-id="dismiss-disclaimer"
/>
<CheckBox isChecked={dismissDisclaimerChecked} data-testid="dismiss-disclaimer" />
<Text
ff="Inter|SemiBold"
fontSize={4}
Expand All @@ -147,7 +144,7 @@ export const LiveAppDrawer = () => {
</Text>
</Box>

<Button primary onClick={onContinue} data-test-id="drawer-continue-button">
<Button primary onClick={onContinue} data-testid="drawer-continue-button">
{t("platform.disclaimer.CTA")}
</Button>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Activity = styled.div`

function LoadingPlaceholder({ style }: { style?: React.CSSProperties }) {
return (
<Wrapper data-test-id="loading-placeholder" style={style}>
<Wrapper data-testid="loading-placeholder" style={style}>
<Activity />
</Wrapper>
);
Expand Down
Loading

0 comments on commit f6a607d

Please sign in to comment.