Skip to content

Commit

Permalink
data test id added for draft detail (#1819)
Browse files Browse the repository at this point in the history
  • Loading branch information
auslin-aot authored Jan 1, 2024
1 parent c2d9526 commit db9261a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion forms-flow-web/src/components/Draft/Edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ const View = React.memo((props) => {
onConfirm={props.onConfirm}
></SubmissionError>
{isAuthenticated ? (
<Link title={t("Back to Drafts")} to={`${redirectUrl}draft`} className="">
<Link data-testid="back-to-drafts-link" title={t("Back to Drafts")} to={`${redirectUrl}draft`} className="">
<i className="fa fa-chevron-left fa-lg me-2" />
</Link>
) : null}
Expand All @@ -265,6 +265,7 @@ const View = React.memo((props) => {
</div>
{processData?.status === "active" ? (
<button
data-testid="draft-discard"
className="btn btn-danger me-2"
style={{ width: "8.5em" }}
onClick={() => deleteDraft()}
Expand Down
5 changes: 4 additions & 1 deletion forms-flow-web/src/components/Draft/ViewDraft.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const ViewDraft = React.memo(() => {
return (
<div className="" id="main">
<div className="d-flex align-items-center">
<Link title={t("Back to Drafts")} to={`${redirectUrl}draft`} className="mt-1">
<Link data-testid="back-to-drafts-link" title={t("Back to Drafts")} to={`${redirectUrl}draft`} className="mt-1">
<i className="fa fa-chevron-left fa-lg me-2" />
</Link>
<h3 className="">
Expand All @@ -83,18 +83,21 @@ const ViewDraft = React.memo(() => {
<br />
<Tabs id="application-details" defaultActiveKey="details" mountOnEnter>
<Tab
data-testid="draft-details-tab"
eventKey="details"
title={<Translation>{(t) => t("Details")}</Translation>}
>
<Details draft={draftDetail} />
</Tab>
<Tab
data-testid="draft-form-tab"
eventKey="form"
title={<Translation>{(t) => t("Form")}</Translation>}
>
<View page="draft-detail" showPrintButton={false} />
</Tab>
<Tab
data-testid="draft-process-diagram-tab"
eventKey="process-diagram"
title={<Translation>{(t) => t("Process Diagram")}</Translation>}
>
Expand Down

0 comments on commit db9261a

Please sign in to comment.