Skip to content

Commit 628feb4

Browse files
authored
Merge pull request #584 from athul-aot/bugfix/FWF-3740-update-data-test-id
Bugfix/FWF 3740 updated missing data testid in microfrontend
2 parents 01b7ec4 + 0571fb3 commit 628feb4

File tree

12 files changed

+29
-17
lines changed

12 files changed

+29
-17
lines changed

forms-flow-components/src/components/CustomComponents/BuildModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const BuildModal: React.FC<BuildModalProps> = React.memo(
6868
<b>{t(title)}</b>
6969
</Modal.Title>
7070
<div className="d-flex align-items-center">
71-
<CloseIcon onClick={onClose} />
71+
<CloseIcon onClick={onClose} dataTestId="modal-close"/>
7272
</div>
7373
</Modal.Header>
7474
<Modal.Body className="d-flex">

forms-flow-components/src/components/CustomComponents/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const CustomButton: React.FC<CustomButtonProps> = ({
4949
disabled = false,
5050
icon = false,
5151
className = "",
52-
dataTestId = "",
52+
dataTestId,
5353
ariaLabel = "",
5454
name = "",
5555
buttonLoading = false,

forms-flow-components/src/components/CustomComponents/ConfirmModal.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ interface ConfirmModalProps {
2222
secondoryBtndataTestid?: string;
2323
secondoryBtnariaLabel?: string;
2424
secondaryBtnLoading?:boolean;
25+
datatestId?: string;
26+
titleDataTestId?: string;
2527
}
2628

2729
export const ConfirmModal: React.FC<ConfirmModalProps> = React.memo(({
@@ -41,7 +43,9 @@ export const ConfirmModal: React.FC<ConfirmModalProps> = React.memo(({
4143
secondaryBtnDisable = false,
4244
secondoryBtndataTestid = 'cancel-button',
4345
secondoryBtnariaLabel = 'Cancel Button',
44-
secondaryBtnLoading= false
46+
secondaryBtnLoading= false,
47+
datatestId,
48+
titleDataTestId,
4549
}) => {
4650
const { t } = useTranslation();
4751
return (
@@ -55,7 +59,7 @@ export const ConfirmModal: React.FC<ConfirmModalProps> = React.memo(({
5559
aria-describedby="confirm-modal-message"
5660
>
5761
<Modal.Header>
58-
<Modal.Title id="confirm-modal-title">
62+
<Modal.Title id="confirm-modal-title" data-testid={titleDataTestId}>
5963
<b>
6064
{t(title)}
6165
</b>
@@ -71,7 +75,7 @@ export const ConfirmModal: React.FC<ConfirmModalProps> = React.memo(({
7175
>
7276
<div
7377
className="message-primary"
74-
data-testid="confirm-modal-primary-message"
78+
data-testid={ datatestId }
7579
aria-label="Primary message"
7680
>
7781
{t(message)}

forms-flow-components/src/components/CustomComponents/CustomInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const CustomInfo: FC<CustomInfoProps> = ( {
2828

2929

3030
return (
31-
<div className={`info-panel ${className}`} data-test-id={dataTestId}>
31+
<div className={`info-panel ${className}`} data-testid={dataTestId}>
3232
<div className="d-flex align-items-center">
3333
<NewInfoIcon />
3434
<div className="field-label ms-2">{t(heading)}</div>

forms-flow-components/src/components/CustomComponents/FormBuilderModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export const FormBuilderModal: React.FC<BuildFormModalProps> = React.memo(
137137
<b>{t(modalHeader)}</b>
138138
</Modal.Title>
139139
<div className="d-flex align-items-center">
140-
<CloseIcon onClick={onClose} />
140+
<CloseIcon onClick={onClose} data-testid="close-duplicate-modal"/>
141141
</div>
142142
</Modal.Header>
143143
<Modal.Body className="form-builder-modal">

forms-flow-components/src/components/CustomComponents/ImportModal.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ export const ImportModal: React.FC<ImportModalProps> = React.memo(
361361
? selectedLayoutVersion.label
362362
: t("Skip, do not import")}
363363
</div>
364-
<DropdownIcon />
364+
<DropdownIcon dataTestId="import-dropdown-layout"/>
365365
</div>
366366
</Dropdown.Toggle>
367367
<Dropdown.Menu>
@@ -396,7 +396,7 @@ export const ImportModal: React.FC<ImportModalProps> = React.memo(
396396
? selectedFlowVersion.label
397397
: t("Skip, do not import")}
398398
</div>
399-
<DropdownIcon />
399+
<DropdownIcon dataTestId="import-dropdown-flow" />
400400
</div>
401401
</Dropdown.Toggle>
402402
<Dropdown.Menu>
@@ -493,6 +493,7 @@ export const ImportModal: React.FC<ImportModalProps> = React.memo(
493493
</Modal.Title>
494494
<div className="d-flex align-items-center">
495495
<CloseIcon
496+
dataTestId="import-modal-close-icon"
496497
width={16.5}
497498
height={16.5}
498499
onClick={() => {
@@ -531,6 +532,7 @@ export const ImportModal: React.FC<ImportModalProps> = React.memo(
531532
buttonLoading={!importError && importLoader}
532533
/>
533534
<CustomButton
535+
dataTestId="import-modal-close-button"
534536
variant="secondary"
535537
size="md"
536538
label="Cancel"

forms-flow-components/src/components/CustomComponents/SortableHeadder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const SortableHeader: React.FC<SortableHeaderProps> = ({
4747
>
4848
<span className="mt-1">{t(title)}</span>
4949
<span className={sortedOrder === "asc" ? "arrow-up" : "arrow-down"}>
50-
<SortIcon color={iconColor} />
50+
<SortIcon color={iconColor} dataTestId="sort" />
5151
</span>
5252
</button>
5353
);

forms-flow-components/src/components/CustomComponents/TableFooter.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ export const TableFooter: React.FC<TableFooterProps> = ({
5151
linkClass="page-link"
5252
onChange={handlePageChange}
5353
prevPageText={
54-
<span><AngleLeftIcon /></span>
54+
<span data-testid="goto-previous"><AngleLeftIcon /></span>
5555
}
5656
nextPageText={
57-
<span><AngleRightIcon /></span>
57+
<span data-testid="goto-next"><AngleRightIcon /></span>
5858
}
59+
5960
/>
6061
</div>
6162
</td>

forms-flow-components/src/components/SvgIcons/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ export const CloseIcon = ({
220220
color = grayColor,
221221
width = 14,
222222
height = 14,
223+
dataTestId = "close-icon",
223224
...props
224225
}) => (
225226
<svg
@@ -229,6 +230,7 @@ export const CloseIcon = ({
229230
viewBox="0 0 14 14"
230231
fill="none"
231232
onClick={props.onClick}
233+
data-testid={dataTestId}
232234
{...props}
233235
>
234236
<path
@@ -508,6 +510,7 @@ export const BackToPrevIcon = ({ color = baseColor, onClick, ...props }) => (
508510
viewBox="0 0 32 33"
509511
fill="none"
510512
onClick={onClick}
513+
{...props}
511514
>
512515
<path
513516
fillRule="evenodd"
@@ -664,8 +667,9 @@ export const TickIcon = ({ color = baseColor, ...props }) => (
664667
</svg>
665668
);
666669

667-
export const DropdownIcon = ({ color = baseColor }) => (
670+
export const DropdownIcon = ({ color = baseColor,dataTestId, ...props}) => (
668671
<svg
672+
data-testid={dataTestId}
669673
xmlns="http://www.w3.org/2000/svg"
670674
width="16"
671675
height="9"
@@ -766,13 +770,14 @@ export const FilterIcon = ({ color = baseColor, ...props }) => (
766770
</svg>
767771
);
768772

769-
export const SortIcon = ({ color = grayColor, ...props }) => (
773+
export const SortIcon = ({ dataTestId, color = grayColor, ...props }) => (
770774
<svg
771775
width="12"
772776
height="17"
773777
viewBox="0 0 12 17"
774778
fill="none"
775779
xmlns="http://www.w3.org/2000/svg"
780+
data-testid={dataTestId}
776781
>
777782
<path
778783
d="M6 15.5L6 1.5M6 1.5L11 5.5M6 1.5L1 5.5"

forms-flow-nav/src/root.component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default function Root(props) {
6666
</div>
6767
)}
6868
<HamburgerMenu props={props} />
69-
{ !isPreviewRoute && <div className="main-sidenav" ref={sidenavRef}>
69+
{ !isPreviewRoute && <div className="main-sidenav" ref={sidenavRef} data-testid="main-sidenav">
7070
<Sidebar props={props} sidenavHeight={sidenavHeight}/>
7171
</div>}
7272
</>

0 commit comments

Comments
 (0)