Skip to content

Commit

Permalink
🪟 🔧 add data-testids for connection status error messages (#12542)
Browse files Browse the repository at this point in the history
  • Loading branch information
chandlerprall committed May 21, 2024
1 parent 8bbbe55 commit ac5b892
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion airbyte-webapp/src/components/ui/Message/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@ export const Message: React.FC<React.PropsWithChildren<MessageProps>> = ({
{mainMessage}
</FlexContainer>
{isRenderingChildren && (
<div className={classNames(styles.childrenContainer, childrenClassName, STYLES_BY_TYPE[type])}>{children}</div>
<div
className={classNames(styles.childrenContainer, childrenClassName, STYLES_BY_TYPE[type])}
data-testid={testId ? `${testId}-children` : undefined}
>
{children}
</div>
)}
</FlexContainer>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export const ConnectionStatusMessages: React.FC = () => {
: "connection.stream.status.checkDestinationSettings",
}),
type: "error",
"data-testid": `connection-status-message-error-${isSourceError ? "source" : "destination"}`,
} as const;

errorMessages.push(configError);
Expand Down Expand Up @@ -142,6 +143,7 @@ export const ConnectionStatusMessages: React.FC = () => {
),
childrenClassName: styles.internalErrorMessage,
isExpandable: hasInternalErrorMessage,
"data-testid": `connection-status-message-warning`,
} as const;
errorMessages.push(goToLogError);
}
Expand All @@ -156,6 +158,7 @@ export const ConnectionStatusMessages: React.FC = () => {
onAction: () => navigate(`../${ConnectionRoutePaths.Replication}`, { state: { triggerRefreshSchema: true } }),
actionBtnText: formatMessage({ id: "connection.schemaChange.reviewAction" }),
type: "error",
"data-testid": `connection-status-message-breaking-schema-change`,
});
}

Expand Down

0 comments on commit ac5b892

Please sign in to comment.