Skip to content

Commit

Permalink
chore: add data-test attributes for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardo committed Dec 20, 2024
1 parent e309ff9 commit 0a0e8a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/DataDimension/Info/InfoPopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { IndicatorInfo } from './IndicatorInfo.js'
import { ProgramIndicatorInfo } from './ProgramIndicatorInfo.js'
import styles from './styles/InfoPopover.style.js'

export const InfoPopover = ({ reference, onClose, ...props }) => {
export const InfoPopover = ({ reference, onClose, dataTest, ...props }) => {
const type = props.item.type

const infoProps = {
Expand All @@ -39,7 +39,7 @@ export const InfoPopover = ({ reference, onClose, ...props }) => {
arrow={false}
elevation="rgba(0, 0, 0, 0.1) 0px 1px 5px, rgba(0, 0, 0, 0.07) 0px 3.6px 13px, rgba(0, 0, 0, 0.06) 0px 8.4px 23px, rgba(0, 0, 0, 0.05) 0px 23px 35px"
>
<div className="popover">
<div className="popover" data-test={`${dataTest}-table`}>
{type === DIMENSION_TYPE_DATA_ELEMENT && (
<DataElementInfo {...infoProps} />
)}
Expand Down Expand Up @@ -70,6 +70,7 @@ export const InfoPopover = ({ reference, onClose, ...props }) => {
}

InfoPopover.propTypes = {
dataTest: PropTypes.string,
displayNameProp: PropTypes.string,
item: PropTypes.object,
reference: PropTypes.object,
Expand Down
1 change: 1 addition & 0 deletions src/components/DataDimension/ItemSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ const ItemSelector = ({
)}
{currentDataItem && (
<InfoPopover
dataTest={`${dataTest}-info`}
item={currentDataItem}
reference={itemsRef.current.get(currentDataItem.id)}
onClose={() => setCurrentDataItem()}
Expand Down

0 comments on commit 0a0e8a5

Please sign in to comment.