Skip to content

Commit f1524c9

Browse files
Merge pull request #292 from multiversx/development
0.1.13
2 parents bee550e + 5c7a0c2 commit f1524c9

File tree

25 files changed

+107
-70
lines changed

25 files changed

+107
-70
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [[0.1.13](https://github.com/multiversx/mx-sdk-dapp-ui/pull/293)] - 2026-01-20
11+
12+
- [Fixed data-testid attributes](https://github.com/multiversx/mx-sdk-dapp-ui/pull/293)
13+
- [Fixed Button data-testid attribute](https://github.com/multiversx/mx-sdk-dapp-ui/pull/292)
14+
1015
## [[0.1.12](https://github.com/multiversx/mx-sdk-dapp-ui/pull/291)] - 2026-01-15
1116

1217
- [Fixed issue with sheetDismiss on SidePanelSwiper](https://github.com/multiversx/mx-sdk-dapp-ui/pull/290)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@multiversx/sdk-dapp-ui",
3-
"version": "0.1.12",
3+
"version": "0.1.13",
44
"description": "A library to hold UI components for a dApp on the MultiversX blockchain",
55
"author": "MultiversX",
66
"license": "MIT",

src/common/Button/Button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ButtonSizeEnum, ButtonVariantEnum } from './button.types';
55

66
interface ButtonPropsType {
77
class?: string;
8-
dataTestId?: string;
8+
'data-testid'?: string;
99
disabled?: boolean;
1010
size?: `${ButtonSizeEnum}`;
1111
variant?: `${ButtonVariantEnum}`;
@@ -15,7 +15,7 @@ interface ButtonPropsType {
1515
export function Button(
1616
{
1717
class: className = '',
18-
dataTestId = '',
18+
'data-testid': dataTestId = '',
1919
disabled = false,
2020
size = 'large',
2121
variant = 'primary',

src/common/ExplorerLink/ExplorerLink.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@ const styles = {
1010
interface ExplorerLinkPropsType {
1111
class?: string;
1212
iconClass?: string;
13-
dataTestId?: string;
13+
'data-testid'?: string;
1414
link: string;
1515
hasIcon?: boolean;
1616
}
1717

1818
export function ExplorerLink(
19-
{ class: className, iconClass, dataTestId, link, hasIcon }: ExplorerLinkPropsType,
19+
{
20+
class: className,
21+
iconClass,
22+
'data-testid': dataTestId,
23+
link,
24+
hasIcon
25+
}: ExplorerLinkPropsType,
2026
children?: JSX.Element,
2127
) {
2228
if (!link) {
Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import { h } from '@stencil/core';
2+
13
import { InvalidFormatAmount, ValidFormatAmount } from './components';
24

35
interface FormatAmountPropsType {
46
class?: string;
5-
dataTestId?: string;
7+
'data-testid'?: string;
68
isValid: boolean;
79
label?: string;
810
labelClass?: string;
@@ -14,7 +16,7 @@ interface FormatAmountPropsType {
1416

1517
export function FormatAmount({
1618
class: className,
17-
dataTestId,
19+
'data-testid': dataTestId,
1820
isValid,
1921
label,
2022
labelClass,
@@ -23,16 +25,19 @@ export function FormatAmount({
2325
valueInteger,
2426
decimalClass,
2527
}: FormatAmountPropsType) {
26-
return isValid
27-
? ValidFormatAmount({
28-
dataTestId,
29-
class: className,
30-
valueInteger,
31-
valueDecimal,
32-
decimalClass,
33-
showLabel,
34-
label,
35-
labelClass,
36-
})
37-
: InvalidFormatAmount({ dataTestId, class: className });
28+
29+
if (isValid) {
30+
return <ValidFormatAmount
31+
data-testid={dataTestId}
32+
class={className}
33+
valueInteger={valueInteger}
34+
valueDecimal={valueDecimal}
35+
decimalClass={decimalClass}
36+
showLabel={showLabel}
37+
label={label}
38+
labelClass={labelClass}
39+
/>;
40+
}
41+
42+
return <InvalidFormatAmount data-testid={dataTestId} class={className} />;
3843
}

src/common/FormatAmount/components/InvalidFormatAmount.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ const styles = {
88

99
interface InvalidFormatAmountPropsType {
1010
class?: string;
11-
dataTestId?: string;
11+
'data-testid'?: string;
1212
}
1313

14-
export function InvalidFormatAmount({ dataTestId, class: className }: InvalidFormatAmountPropsType) {
14+
export function InvalidFormatAmount({
15+
'data-testid': dataTestId,
16+
class: className,
17+
}: InvalidFormatAmountPropsType) {
1518
return (
1619
<span data-testid={dataTestId ?? DataTestIdsEnum.formatAmountComponent} class={className}>
1720
<span class={styles.intAmount} data-testid={DataTestIdsEnum.formatAmountInt}>

src/common/FormatAmount/components/ValidFormatAmount.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const styles = {
1212

1313
interface ValidFormatAmountPropsType {
1414
class?: string;
15-
dataTestId?: string;
15+
'data-testid'?: string;
1616
label?: string;
1717
labelClass?: string;
1818
showLabel?: boolean;
@@ -22,7 +22,7 @@ interface ValidFormatAmountPropsType {
2222
}
2323

2424
export function ValidFormatAmount({
25-
dataTestId,
25+
'data-testid': dataTestId,
2626
class: className,
2727
valueInteger,
2828
valueDecimal,

src/common/Trim/Trim.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ import { safeWindow } from 'constants/window.constants';
66
import styles from './trim.styles';
77

88
interface TrimPropsType {
9-
dataTestId?: string;
9+
'data-testid'?: string;
1010
class?: string;
1111
text: string;
1212
}
1313

14-
export function Trim({ dataTestId = DataTestIdsEnum.trim, class: className, text }: TrimPropsType) {
14+
export function Trim({
15+
'data-testid': dataTestId = DataTestIdsEnum.trim,
16+
class: className,
17+
text,
18+
}: TrimPropsType) {
1519
let fullWidthUntrimmedElementReference: HTMLDivElement;
1620
let trimElementReference: HTMLDivElement;
1721
let resizeObserver: ResizeObserver;

src/common/UnlockButton/UnlockButton.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,19 @@ interface UnlockButtonPropsType {
2020
label: string;
2121
iconUrl: string;
2222
icon?: HTMLElement;
23-
dataTestId?: string;
23+
'data-testid'?: string;
2424
type?: IProviderBase['type'];
2525
class?: string;
2626
}
2727

28-
export function UnlockButton({ label, iconUrl, icon, dataTestId, type, class: className }: UnlockButtonPropsType) {
28+
export function UnlockButton({
29+
label,
30+
iconUrl,
31+
icon,
32+
'data-testid': dataTestId,
33+
type,
34+
class: className,
35+
}: UnlockButtonPropsType) {
2936
const isExtensionProvider = type === ProviderTypeEnum.extension;
3037
const isMetaMaskProvider = type === ProviderTypeEnum.metamask;
3138
const isDetectableProvider = isExtensionProvider || isMetaMaskProvider;

src/components/controlled/format-amount/format-amount.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { FormatAmount as FormatAmountComponent } from 'common/FormatAmount/Forma
77
})
88
export class FormatAmount {
99
@Prop() class?: string;
10-
@Prop() dataTestId?: string;
10+
@Prop({ attribute: 'data-testid' }) dataTestId?: string;
1111
@Prop() isValid: boolean;
1212
@Prop() label?: string;
1313
@Prop() labelClass?: string;
@@ -20,7 +20,7 @@ export class FormatAmount {
2020
return (
2121
<FormatAmountComponent
2222
class={this.class}
23-
dataTestId={this.dataTestId}
23+
data-testid={this.dataTestId}
2424
isValid={this.isValid}
2525
label={this.label}
2626
labelClass={this.labelClass}

0 commit comments

Comments
 (0)