Skip to content

Commit 3fc54da

Browse files
committed
chore: frontend test
1 parent f9fb158 commit 3fc54da

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

bciers/apps/administration/tests/components/operations/OperationInformationForm.test.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,8 @@ describe("the OperationInformationForm component", () => {
396396
fireEvent.change(nameInput, { target: { value: "Operation 4" } });
397397
});
398398

399+
actionHandler.mockResolvedValueOnce(formData);
400+
399401
// Click the Save button
400402
await act(async () => {
401403
screen.getByRole("button", { name: /save/i }).click();
@@ -438,6 +440,9 @@ describe("the OperationInformationForm component", () => {
438440
// Click the Edit button
439441
screen.getByRole("button", { name: "Edit" }).click();
440442
});
443+
444+
actionHandler.mockResolvedValueOnce(optInFormData);
445+
441446
await act(async () => {
442447
// Grab all radio buttons
443448
const allNoRadioButtons: HTMLInputElement[] = screen.getAllByRole(
@@ -886,6 +891,9 @@ describe("the OperationInformationForm component", () => {
886891
const saveButton = screen.getByRole("button", {
887892
name: /save/i,
888893
});
894+
895+
actionHandler.mockResolvedValueOnce(newEntrantFormData);
896+
889897
await userEvent.click(saveButton);
890898
expect(actionHandler).toHaveBeenCalledTimes(1);
891899
expect(actionHandler).toHaveBeenCalledWith(
@@ -999,6 +1007,8 @@ describe("the OperationInformationForm component", () => {
9991007
const representativeOption = await screen.getByText(/Jack King/i);
10001008
await userEvent.click(representativeOption);
10011009

1010+
actionHandler.mockResolvedValueOnce(testFormData);
1011+
10021012
const saveButton = screen.getByRole("button", {
10031013
name: /save/i,
10041014
});

0 commit comments

Comments
 (0)