Skip to content

Commit

Permalink
test: Add NumField helper test
Browse files Browse the repository at this point in the history
  • Loading branch information
d4n1b authored and lordrip committed Oct 8, 2024
1 parent 451a08b commit b0cba30
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/__tests__/NumField.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,13 @@ test("<NumField> - renders a label", () => {
expect(screen.getByTestId("wrapper-field").getElementsByTagName("label")[0].getAttribute("for")).toBe(id);
});

test('<NumField> - renders a help', () => {
render(usingUniformsContext(<NumField required={false} name="x" helperText="y" />, { x: { type: Number } }));

expect(screen.getByTestId('wrapper-field').querySelector('.pf-v5-c-form__helper-text')).toBeInTheDocument();
expect(screen.getByTestId('wrapper-field').querySelector('.pf-v5-c-form__helper-text')?.textContent).toBe('y');
});

test("<NumField> - renders a label", () => {
render(usingUniformsContext(<NumField required={true} name="x" label="y" />, { x: { type: Number } }));

Expand Down

0 comments on commit b0cba30

Please sign in to comment.