Skip to content

Commit

Permalink
Added data test id's (#85)
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Pinate <[email protected]>
  • Loading branch information
CalebGerman and diegopinate authored Feb 22, 2024
1 parent ab80a96 commit ca40d46
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export class ChangedElementsWidget extends Component<ChangedElementsWidgetProps,
</IconButton>
{
this.props.useV2Widget &&
<InfoButton title={IModelApp.localization.getLocalizedString("VersionCompare:versionCompare.versionCompare")} message={this._widgetInfo} />
<InfoButton data-testid="⁠comparison-legend-widget-info" title={IModelApp.localization.getLocalizedString("VersionCompare:versionCompare.versionCompare")} message={this._widgetInfo} />
}
{
this.state.loaded &&
Expand All @@ -324,6 +324,7 @@ export class ChangedElementsWidget extends Component<ChangedElementsWidgetProps,
styleType="borderless"
onClick={this._handleReportGeneration}
title={IModelApp.localization.getLocalizedString("VersionCompare:report.reportGeneration")}
data-testid="comparison-legend-widget-report-generation"
>
<SvgExport />
</IconButton>
Expand Down Expand Up @@ -380,7 +381,7 @@ export class ChangedElementsWidget extends Component<ChangedElementsWidgetProps,
{this.state.loaded ? this.getChangedElementsContent() : this.getLoadingContent()}
</WidgetComponent.Body>
<WidgetComponent.ToolBar>
{(this.props.useV2Widget && (!!this.props.feedbackUrl)) && <FeedbackButton feedbackUrl={this.props.feedbackUrl ?? ""}></FeedbackButton>}
{(this.props.useV2Widget && (!!this.props.feedbackUrl)) && <FeedbackButton data-testid="⁠comparison-widget-v2-feedback-btn" feedbackUrl={this.props.feedbackUrl ?? ""}></FeedbackButton>}
</WidgetComponent.ToolBar>
</WidgetComponent>
{
Expand All @@ -396,6 +397,7 @@ export class ChangedElementsWidget extends Component<ChangedElementsWidgetProps,
<V2DialogProvider>
{this.state.versionSelectDialogVisible &&
<VersionCompareSelectDialogV2
data-testid="⁠comparison-widget-v2-modal"
iModelConnection={this.props.iModelConnection}
onClose={this._handleVersionSelectDialogClose}
/>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import "./FeedbackButton.scss";
interface Props {
/** Link for button to take you to.*/
feedbackUrl: string;
"data-testid" ?: string;
}

/** Feedback button that on click takes you to provided link.*/
Expand All @@ -22,6 +23,7 @@ export function FeedbackButton(props: Props) {
href={props.feedbackUrl}
target="_blank"
rel="noreferrer"
data-testid={props["data-testid"]}
>
<div className="changed-elems-feedback-content-wrapper">
<SvgSmileyHappy className="changed-elems-feedback-svg" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface Props {
title: string;
// contents of information drop down
message: string;
"data-testid"?: string;
}

/**
Expand All @@ -21,6 +22,7 @@ function InfoButton(props: Props) {
<DropdownMenu
style={{ width: 500 }}
placement="bottom-end"
data-testid={props["data-testid"]}
menuItems={() => [
<MenuExtraContent key={0}>
<Text variant="leading">{props.title}</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export interface VersionCompareSelectDialogV2Props {
iModelConnection: IModelConnection;
/** onClose triggered when user clicks start comparison or closes dialog.*/
onClose: (() => void) | undefined;
"data-testid"?: string;
}

type V2Context = {
Expand Down Expand Up @@ -231,6 +232,7 @@ export function VersionCompareSelectDialogV2(props: VersionCompareSelectDialogV2
};
return (
<Modal
data-testid={props["data-testid"]}
className="comparison-job-dialog"
title={IModelApp.localization.getLocalizedString("VersionCompare:versionCompare.versionPickerTitle")}
isOpen
Expand Down

0 comments on commit ca40d46

Please sign in to comment.