From 618802c90fcec4bd2fc175d991ce1c93b78f263d Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Fri, 11 Oct 2024 11:03:39 +0100 Subject: [PATCH] run prettier on edited files --- .../@planx/components/NumberInput/Editor.tsx | 4 +-- .../components/NumberInput/Public.test.tsx | 28 +++++++++---------- .../@planx/components/NumberInput/model.ts | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/editor.planx.uk/src/@planx/components/NumberInput/Editor.tsx b/editor.planx.uk/src/@planx/components/NumberInput/Editor.tsx index b60e006562..8daf569c78 100644 --- a/editor.planx.uk/src/@planx/components/NumberInput/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/NumberInput/Editor.tsx @@ -80,7 +80,7 @@ export default function NumberInputComponent(props: Props): FCReturn { onChange={() => formik.setFieldValue( "allowNegatives", - !formik.values.allowNegatives + !formik.values.allowNegatives, ) } /> @@ -96,7 +96,7 @@ export default function NumberInputComponent(props: Props): FCReturn { onChange={() => formik.setFieldValue( "onlyWholeNumbers", - !formik.values.onlyWholeNumbers + !formik.values.onlyWholeNumbers, ) } /> diff --git a/editor.planx.uk/src/@planx/components/NumberInput/Public.test.tsx b/editor.planx.uk/src/@planx/components/NumberInput/Public.test.tsx index fb09bd1dc5..ef08b00fa8 100644 --- a/editor.planx.uk/src/@planx/components/NumberInput/Public.test.tsx +++ b/editor.planx.uk/src/@planx/components/NumberInput/Public.test.tsx @@ -11,7 +11,7 @@ test("renders correctly", async () => { const handleSubmit = vi.fn(); const { user } = setup( - + , ); expect(screen.getByRole("heading")).toHaveTextContent("Numberwang!"); @@ -26,7 +26,7 @@ test("allows 0 to be input as a valid number", async () => { const handleSubmit = vi.fn(); const { user } = setup( - + , ); expect(screen.getByRole("heading")).toHaveTextContent("Numberwang!"); @@ -45,16 +45,16 @@ test("requires a positive number to be input by default", async () => { fn="doors" title="How many doors are you adding?" handleSubmit={handleSubmit} - /> + />, ); expect(screen.getByRole("heading")).toHaveTextContent( - "How many doors are you adding?" + "How many doors are you adding?", ); await user.type( screen.getByLabelText("How many doors are you adding?"), - "-1" + "-1", ); await user.click(screen.getByTestId("continue-button")); @@ -71,11 +71,11 @@ test("allows negative numbers to be input when toggled on by editor", async () = title="What's the temperature?" handleSubmit={handleSubmit} allowNegatives={true} - /> + />, ); expect(screen.getByRole("heading")).toHaveTextContent( - "What's the temperature?" + "What's the temperature?", ); await user.type(screen.getByLabelText("What's the temperature?"), "-10"); @@ -93,11 +93,11 @@ test("requires only whole numbers to be input when toggled on by editor", async title="What's the temperature?" handleSubmit={handleSubmit} onlyWholeNumbers={true} - /> + />, ); expect(screen.getByRole("heading")).toHaveTextContent( - "What's the temperature?" + "What's the temperature?", ); const textArea = screen.getByLabelText("What's the temperature?"); @@ -120,11 +120,11 @@ test("allows only whole numbers to be input when toggled on by editor", async () title="What's the temperature?" handleSubmit={handleSubmit} onlyWholeNumbers={true} - /> + />, ); expect(screen.getByRole("heading")).toHaveTextContent( - "What's the temperature?" + "What's the temperature?", ); const textArea = screen.getByLabelText("What's the temperature?"); @@ -138,7 +138,7 @@ test("requires a value before being able to continue", async () => { const handleSubmit = vi.fn(); const { user } = setup( - + , ); await user.click(screen.getByTestId("continue-button")); @@ -160,7 +160,7 @@ test("recovers previously submitted number when clicking the back button", async [componentId]: 43, }, }} - /> + />, ); await user.click(screen.getByTestId("continue-button")); @@ -184,7 +184,7 @@ test("recovers previously submitted number when clicking the back button even if [dataField]: 43, }, }} - /> + />, ); await user.click(screen.getByTestId("continue-button")); diff --git a/editor.planx.uk/src/@planx/components/NumberInput/model.ts b/editor.planx.uk/src/@planx/components/NumberInput/model.ts index 52f418b990..6913676743 100644 --- a/editor.planx.uk/src/@planx/components/NumberInput/model.ts +++ b/editor.planx.uk/src/@planx/components/NumberInput/model.ts @@ -22,7 +22,7 @@ export const parseNumber = (raw: string): number | null => { }; export const parseNumberInput = ( - data: Record | undefined + data: Record | undefined, ): NumberInput => ({ title: data?.title || "", description: data?.description,