Skip to content

Commit

Permalink
Merged in r2-3105-missing-label-form-export (pull request #7006)
Browse files Browse the repository at this point in the history
R2-3105 - W - Missing 'Show hidden fields' label on form export modal

Approved-by: Dennis Hernandez
  • Loading branch information
aespinoza-quoin committed Dec 5, 2024
2 parents 728dc7f + 504ebe6 commit 943f3df
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/javascript/components/form/fields/radio-input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function RadioInput({ commonInputProps, options, formMethods }) {

return (
<FormControl id={name} error={error} className={className}>
<FormLabel component="legend" className="MuiInputLabel-root">
<FormLabel component="label" className={css.radioLabel}>
{radioGroupLabel}
</FormLabel>
<Controller
Expand Down
33 changes: 33 additions & 0 deletions app/javascript/components/form/fields/radio-input.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { screen, mountedFieldComponent } from "test-utils";

import RadioInput from "./radio-input";

describe("<Form /> - fields/<RadioInput />", () => {
const props = {
commonInputProps: {
label: "Test Field 2",
name: "test"
},
options: [
{ id: 1, display_text: "option-1" },
{ id: 2, display_text: "option-2" }
],
formMethods: {}
};

it("renders RadioInput inputs", () => {
mountedFieldComponent(<RadioInput {...props} />);
expect(screen.getByText("option-1")).toBeInTheDocument();
expect(screen.getByText("option-2")).toBeInTheDocument();
});

it("renders help text", () => {
mountedFieldComponent(<RadioInput {...props} />);
expect(screen.getByText("Test Field 2 help text")).toBeInTheDocument();
});

it("renders label", () => {
mountedFieldComponent(<RadioInput {...props} />);
expect(screen.getByText("Test Field 2")).toBeInTheDocument();
});
});
5 changes: 5 additions & 0 deletions app/javascript/components/form/fields/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,8 @@
.downloadButton {
padding-top: 10px;
}

.radioLabel {
font-weight: bold;
color: var(--c-solid-black);
}

0 comments on commit 943f3df

Please sign in to comment.