Add automation ids for acceptance tests
[MAILPOET-3469]
This commit is contained in:
@@ -4,10 +4,11 @@ import classnames from 'classnames';
|
|||||||
type Props = {
|
type Props = {
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
automationId?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ThreeColumns = ({ children, className }: Props): React.ReactElement => (
|
export const ThreeColumns = ({ children, className, automationId }: Props): React.ReactElement => (
|
||||||
<div className={classnames(className, 'mailpoet-grid-three-columns')}>
|
<div className={classnames(className, 'mailpoet-grid-three-columns')} data-automation-id={automationId}>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@@ -22,7 +22,7 @@ const ConditionType: React.FunctionComponent = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div>
|
<div>
|
||||||
<label className="mailpoet-form-radio">
|
<label className="mailpoet-form-radio" data-automation-id="dynamic-segment-condition-type-and">
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
value={SegmentConnectTypes.AND}
|
value={SegmentConnectTypes.AND}
|
||||||
@@ -40,7 +40,7 @@ const ConditionType: React.FunctionComponent = () => {
|
|||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
<label className="mailpoet-form-radio">
|
<label className="mailpoet-form-radio" data-automation-id="dynamic-segment-condition-type-or">
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
value={SegmentConnectTypes.OR}
|
value={SegmentConnectTypes.OR}
|
||||||
|
@@ -107,11 +107,12 @@ export const Form: React.FunctionComponent<Props> = ({
|
|||||||
<ConditionType />
|
<ConditionType />
|
||||||
{Array.isArray(filterRows) && filterRows.map((filterRow, index) => (
|
{Array.isArray(filterRows) && filterRows.map((filterRow, index) => (
|
||||||
<React.Fragment key={filterRow.index}>
|
<React.Fragment key={filterRow.index}>
|
||||||
<Grid.ThreeColumns>
|
<Grid.ThreeColumns automationId={`filter-row-${index}`}>
|
||||||
{filterRows.length > 1 && (
|
{filterRows.length > 1 && (
|
||||||
<a
|
<a
|
||||||
href={undefined}
|
href={undefined}
|
||||||
className="mailpoet-form-segment-delete"
|
className="mailpoet-form-segment-delete"
|
||||||
|
data-automation-id="delete-filter-row"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const filters = segment.filters;
|
const filters = segment.filters;
|
||||||
|
Reference in New Issue
Block a user