From bf8931d18b5efa3fd23844043ec134818d6b06ec Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Tue, 17 Sep 2024 14:34:09 +0100 Subject: [PATCH] update utils inline with new happy path --- .../components/MapAndLabel/test/utils.ts | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/editor.planx.uk/src/@planx/components/MapAndLabel/test/utils.ts b/editor.planx.uk/src/@planx/components/MapAndLabel/test/utils.ts index 00de0c3268..1873246808 100644 --- a/editor.planx.uk/src/@planx/components/MapAndLabel/test/utils.ts +++ b/editor.planx.uk/src/@planx/components/MapAndLabel/test/utils.ts @@ -32,19 +32,6 @@ export const addMultipleFeatures = ( }); }; -export const fillOutForm = async (user: UserEvent) => { - const speciesInput = screen.getByLabelText("Species"); - await user.type(speciesInput, mockTreeData.species); - const workInput = screen.getByLabelText("Proposed work"); - await user.type(workInput, mockTreeData.work); - const justificationInput = screen.getByLabelText("Justification"); - await user.type(justificationInput, mockTreeData.justification); - const urgencyDiv = screen.getByTitle("Urgency"); - const urgencySelect = within(urgencyDiv).getByRole("combobox"); - await user.click(urgencySelect); - await user.click(screen.getByRole("option", { name: /low/i })); -}; - export const fillOutFirstHalfOfForm = async (user: UserEvent) => { const speciesInput = screen.getByLabelText("Species"); await user.type(speciesInput, mockTreeData.species); @@ -61,6 +48,11 @@ export const fillOutSecondHalfOfForm = async (user: UserEvent) => { await user.click(screen.getByRole("option", { name: /low/i })); }; +export const fillOutForm = async (user: UserEvent) => { + await fillOutFirstHalfOfForm(user); + await fillOutSecondHalfOfForm(user); +}; + export const clickContinue = async (user: UserEvent) => { const continueButton = screen.getByRole("button", { name: /Continue/ }); await user.click(continueButton);