Skip to content

Commit

Permalink
chore: add comment to url widget test
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellmueller committed May 6, 2024
1 parent ed013cf commit 48bbd90
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,6 @@ describe("RJSF URLWidget", () => {
expect(input).toHaveValue(url);
});

// it("should trigger validation error for required field", async () => {
// render(<FormBase schema={urlFieldSchema} uiSchema={urlFieldUiSchema} />);
// const submitButton = screen.getByRole("button", { name: "Submit" });
//
// await userEvent.click(submitButton);
//
// expect(screen.getByText("Required field")).toBeVisible();
// });

it("should trigger validation error for invalid URL", async () => {
render(<FormBase schema={urlFieldSchema} uiSchema={urlFieldUiSchema} />);
const input = screen.getByLabelText(urlLabelRequired);
Expand All @@ -91,6 +82,18 @@ describe("RJSF URLWidget", () => {
expect(screen.queryByText(urlErrorMessage)).toBeNull();
});

// Todo: Fix bug preventing required field validation
// https://github.com/bcgov/cas-registration/issues/1612

// it("should trigger validation error for required field", async () => {
// render(<FormBase schema={urlFieldSchema} uiSchema={urlFieldUiSchema} />);
// const submitButton = screen.getByRole("button", { name: "Submit" });
//
// await userEvent.click(submitButton);
//
// expect(screen.getByText("Required field")).toBeVisible();
// });

// it("should have the correct styling when validation is triggered", async () => {
// await checkTextWidgetValidationStyles(
// <FormBase schema={urlFieldSchema} uiSchema={urlFieldUiSchema} />,
Expand Down

0 comments on commit 48bbd90

Please sign in to comment.