Skip to content

Commit

Permalink
update utils inline with new happy path
Browse files Browse the repository at this point in the history
  • Loading branch information
RODO94 committed Sep 17, 2024
1 parent 523e47c commit bf8931d
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions editor.planx.uk/src/@planx/components/MapAndLabel/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit bf8931d

Please sign in to comment.