From e0c7b5af2ac93452453b8d7916b6ecc16394cc42 Mon Sep 17 00:00:00 2001 From: Jo Humphrey <31373245+jamdelion@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:41:59 +0100 Subject: [PATCH] feat: add export/print button to Upload+Label and Review components (#3771) --- .../FileUploadAndLabel/Public.test.tsx | 26 +++++++++++++++++-- .../components/FileUploadAndLabel/Public.tsx | 2 ++ .../Review/Public/Presentational.tsx | 2 ++ .../components/Review/Public/Public.test.tsx | 3 ++- .../src/components/PrintButton.tsx | 17 ++++++++++++ 5 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 editor.planx.uk/src/components/PrintButton.tsx diff --git a/editor.planx.uk/src/@planx/components/FileUploadAndLabel/Public.test.tsx b/editor.planx.uk/src/@planx/components/FileUploadAndLabel/Public.test.tsx index 82d5b3cd2b..83d0ee3585 100644 --- a/editor.planx.uk/src/@planx/components/FileUploadAndLabel/Public.test.tsx +++ b/editor.planx.uk/src/@planx/components/FileUploadAndLabel/Public.test.tsx @@ -1,8 +1,7 @@ import { act, screen, waitFor, within } from "@testing-library/react"; import { UserEvent } from "@testing-library/user-event/dist/types/setup/setup"; import axios from "axios"; -import { useStore } from "pages/FlowEditor/lib/store"; -import { FullStore } from "pages/FlowEditor/lib/store"; +import { FullStore, useStore } from "pages/FlowEditor/lib/store"; import React from "react"; import { setup } from "testUtils"; import { Breadcrumbs } from "types"; @@ -60,6 +59,18 @@ describe("Basic state and setup", () => { expect(results).toHaveNoViolations(); }); + it("does not show a print button if hideDropZone is false", async () => { + const { queryByText } = setup( + , + ); + const printButton = queryByText("Print this page"); + expect(printButton).toBeNull(); + }); + test("shows help buttons for header and applicable file", async () => { const { getAllByTestId } = setup(