From 7eaf2c93de537387be8a123417434e0734a75ac1 Mon Sep 17 00:00:00 2001 From: Harvey Date: Mon, 1 Nov 2021 12:52:17 +1100 Subject: [PATCH] test: update test to ensure div content text is being rendered --- src/TestComponent/TestComponent.test.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/TestComponent/TestComponent.test.tsx b/src/TestComponent/TestComponent.test.tsx index 35b8aa3..6e3d22c 100644 --- a/src/TestComponent/TestComponent.test.tsx +++ b/src/TestComponent/TestComponent.test.tsx @@ -25,7 +25,7 @@ describe("TestComponent", () => { it("should render content correctly", () => { const { getByTestId } = renderComponent({ - content:
I am test content
+ content:
I am test content
, }); expect( @@ -33,5 +33,10 @@ describe("TestComponent", () => { "some-test-content" ) ).toBeInTheDocument(); + expect( + within(getByTestId("test-component__content")).queryByTestId( + "some-test-content" + ) + ).toHaveTextContent("I am test content"); }); });