From b0cba30f9e07cac009fa5779e2294fd101899e8d Mon Sep 17 00:00:00 2001 From: Dani Martinez Date: Tue, 8 Oct 2024 21:40:40 +0100 Subject: [PATCH] test: Add NumField helper test --- src/__tests__/NumField.test.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/__tests__/NumField.test.tsx b/src/__tests__/NumField.test.tsx index 53d12cb..f613939 100644 --- a/src/__tests__/NumField.test.tsx +++ b/src/__tests__/NumField.test.tsx @@ -239,6 +239,13 @@ test(" - renders a label", () => { expect(screen.getByTestId("wrapper-field").getElementsByTagName("label")[0].getAttribute("for")).toBe(id); }); +test(' - renders a help', () => { + render(usingUniformsContext(, { 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(" - renders a label", () => { render(usingUniformsContext(, { x: { type: Number } }));