Skip to content

Commit

Permalink
fix: cypress test (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeevaRamu0104 authored Mar 7, 2024
1 parent 2dfb70f commit 15c286f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 26 deletions.
10 changes: 7 additions & 3 deletions src/components/ACLDiv.res
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ let make = (
~contentAlign=?,
~justifyClass=?,
~tooltipForWidthClass=?,
~dataAttrStr=?,
) => {
<ACLToolTip
access=permission
Expand All @@ -21,9 +22,12 @@ let make = (
?contentAlign
?tooltipWidthClass
?justifyClass
toolTipFor={<div className onClick={permission === AuthTypes.Access ? onClick : {_ => ()}}>
{children}
</div>}
toolTipFor={<AddDataAttributes
attributes=[("data-testid", dataAttrStr->Option.getOr("")->String.toLowerCase)]>
<div className onClick={permission === AuthTypes.Access ? onClick : {_ => ()}}>
{children}
</div>
</AddDataAttributes>}
toolTipPosition={Top}
/>
}
1 change: 1 addition & 0 deletions src/components/ACLDiv.resi
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ let make: (
~contentAlign: ToolTip.contentPosition=?,
~justifyClass: string=?,
~tooltipForWidthClass: string=?,
~dataAttrStr: string=?,
) => React.element
46 changes: 23 additions & 23 deletions src/screens/Processors/ProcessorCards.res
Original file line number Diff line number Diff line change
Expand Up @@ -108,30 +108,30 @@ let make = (
let connectorName = connector->getConnectorNameString
let connectorInfo = connector->getConnectorInfo
let size = "w-14 h-14 rounded-sm"
<AddDataAttributes attributes=[("data-testid", connectorName->String.toLowerCase)]>
<ACLDiv
permission={userPermissionJson.connectorsManage}
onClick={_ => handleClick(connectorName)}
key={i->string_of_int}
className="border p-6 gap-4 bg-white rounded flex flex-col justify-between">
<div className="flex flex-col gap-3 items-start">
<GatewayIcon gateway={connectorName->String.toUpperCase} className=size />
<p className={`${p1MediumTextStyle} break-all`}>
{connectorName->getDisplayNameForConnector->React.string}
</p>
</div>
<p className="overflow-hidden text-gray-400 flex-1 line-clamp-3">
{connectorInfo.description->React.string}

<ACLDiv
permission={userPermissionJson.connectorsManage}
onClick={_ => handleClick(connectorName)}
key={i->string_of_int}
className="border p-6 gap-4 bg-white rounded flex flex-col justify-between"
dataAttrStr=connectorName>
<div className="flex flex-col gap-3 items-start">
<GatewayIcon gateway={connectorName->String.toUpperCase} className=size />
<p className={`${p1MediumTextStyle} break-all`}>
{connectorName->getDisplayNameForConnector->React.string}
</p>
<ACLButton
access={userPermissionJson.connectorsManage}
text="+ Connect"
buttonType={Transparent}
buttonSize={Small}
textStyle="text-jp-gray-900"
/>
</ACLDiv>
</AddDataAttributes>
</div>
<p className="overflow-hidden text-gray-400 flex-1 line-clamp-3">
{connectorInfo.description->React.string}
</p>
<ACLButton
access={userPermissionJson.connectorsManage}
text="+ Connect"
buttonType={Transparent}
buttonSize={Small}
textStyle="text-jp-gray-900"
/>
</ACLDiv>
})
->React.array}
</div>
Expand Down

0 comments on commit 15c286f

Please sign in to comment.