diff --git a/CHANGELOG.md b/CHANGELOG.md index c9d31038e..07a114658 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ changes. ### Added -- +- Add missing test DRep Details test IDs [Issue 1863](https://github.com/IntersectMBO/govtool/issues/1863) ### Fixed diff --git a/govtool/frontend/src/pages/DRepDetails.tsx b/govtool/frontend/src/pages/DRepDetails.tsx index bbb80a0b9..96bcfe67f 100644 --- a/govtool/frontend/src/pages/DRepDetails.tsx +++ b/govtool/frontend/src/pages/DRepDetails.tsx @@ -240,13 +240,16 @@ export const DRepDetails = ({ isConnected }: DRepDetailsProps) => { url={url} /> )} - - + + - + - + { {correctAdaFormat(votingPower)} - - {paymentAddress && } + + {paymentAddress && ( + + )} {references?.length > 0 && !metadataStatus && ( - + { )} - + {objectives} - + {motivations} - + {qualifications} @@ -341,18 +364,34 @@ const ellipsisStyles = { type DrepDetailsInfoItemProps = PropsWithChildren & { label: string; + dataTestId: string; }; -const DRepDetailsInfoItem = ({ children, label }: DrepDetailsInfoItemProps) => { +const dataTestIdInfoItemCategoryPrefix = "info-item"; + +const DRepDetailsInfoItem = ({ + children, + label, + dataTestId, +}: DrepDetailsInfoItemProps) => { if (!children) return null; return ( <> - + {label} - + {children} @@ -362,27 +401,42 @@ const DRepDetailsInfoItem = ({ children, label }: DrepDetailsInfoItemProps) => { const DRepDetailsDescriptionItem = ({ children, label, + dataTestId, }: DrepDetailsInfoItemProps) => { if (!children) return null; return ( <> - + {label} - + {children} ); }; -const CopyableText = ({ value }: { value: string }) => ( +type CopyableTextProps = { + value: string; + dataTestId: string; +}; + +const CopyableText = ({ value, dataTestId }: CopyableTextProps) => ( { navigator.clipboard.writeText(value.toString()); e.stopPropagation(); }} - data-testid="copy-drep-id-button" + data-testid={dataTestId} sx={{ gap: 1, maxWidth: "100%",