Skip to content

Commit

Permalink
data-testid added for submission-details (#1820)
Browse files Browse the repository at this point in the history
* data-testid added for submission-details

* data-testid added for export-pdf btn
  • Loading branch information
fahad-aot authored Jan 1, 2024
1 parent 9fc79fd commit c2d9526
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ const ApplicationFilter = ({
<button
className="btn btn-link text-danger"
onClick={clearAllFilters}
data-testid="submission-filter-clear-input-button"
data-testid="submission-filter-clear-button"
>
{t("Clear All Filters")}
</button>
Expand All @@ -202,13 +202,15 @@ const ApplicationFilter = ({
<button
className="btn btn-link text-dark me-1 "
onClick={closeFilterModal}
data-testid="submission-filter-close-button"
>
{t("Cancel")}
</button>
<button
className="btn btn-dark"
onClick={applyFilters}
disabled={!isSearchParamEntered}
data-testid="submission-filter-apply-button"
>
{t("Show results")}
</button>
Expand Down
6 changes: 5 additions & 1 deletion forms-flow-web/src/components/Application/ViewApplication.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const ViewApplication = React.memo(() => {
return (
<div className="">
<div className="d-flex align-items-center">
<Link title={t("Back to Submissions")} to={`${redirectUrl}application`} className="">
<Link data-testid="back-to-submissions-link" title={t("Back to Submissions")} to={`${redirectUrl}application`} className="">
<i className="fa fa-chevron-left fa-lg me-2" />
</Link>
<h3 className=" text-truncate">
Expand All @@ -101,24 +101,28 @@ const ViewApplication = React.memo(() => {
<br />
<Tabs id="application-details" defaultActiveKey="details" mountOnEnter>
<Tab
data-testid="submissions-details-tab"
eventKey="details"
title={<Translation>{(t) => t("Details")}</Translation>}
>
<Details application={applicationDetail} />
</Tab>
<Tab
data-testid="submissions-form-tab"
eventKey="form"
title={<Translation>{(t) => t("Form")}</Translation>}
>
<View page="application-detail" />
</Tab>
<Tab
data-testid="submissions-history-tab"
eventKey="history"
title={<Translation>{(t) => t("History")}</Translation>}
>
<History page="application-detail" applicationId={applicationId} />
</Tab>
<Tab
data-testid="submissions-process-diagram-tab"
eventKey="process-diagram"
title={<Translation>{(t) => t("Process Diagram")}</Translation>}
>
Expand Down
2 changes: 1 addition & 1 deletion forms-flow-web/src/components/Application/historyTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const linkSubmision = (row, redirectUrl) => {
const url = getFormUrl(formId, submissionId, redirectUrl);
return (
<div onClick={() => window.open(url, "_blank")}>
<span className="btn btn-primary btn-sm form-btn">
<span className="btn btn-primary btn-sm form-btn" data-testid="submission-viewsubmission-button" >
<span>
<i className="fa fa-eye" aria-hidden="true"></i>&nbsp;
</span>
Expand Down
2 changes: 1 addition & 1 deletion forms-flow-web/src/components/Form/ExportAsPdf/button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const ExportButton = React.memo(({ buttonState,
const isLoading = buttonState === ButtonState.Loading;
return (
<div className="d-flex justify-content-center">
<InternalButton onClick={onClick} variant="primary" size="sm">
<InternalButton onClick={onClick} variant="primary" size="sm" data-testid="export-pdf-button">
{!isLoading && (
<i className="fa fa-print me-2" aria-hidden="true" />
)}
Expand Down

0 comments on commit c2d9526

Please sign in to comment.