developerasun / myCodeBox-web

Open source code box for web developers.
Apache License 2.0
5 stars 0 forks source link

React/JS : jest received value must be an HTMLElement or an SVGElement. #143

Closed developerasun closed 2 years ago

developerasun commented 2 years ago

issue : jest expect(received).toBeInTheDocument not working

in terminal,

received-value

developerasun commented 2 years ago

solution : fixed received value from array to arrary.length

describe("Add inputs to div integration test", () => {
    test("should do", () => {
        render(<MockTodo />)
        addTask(["wow", "say hello to cat"])
        const divElements = screen.getAllByTestId(/divTodoList/i)
        expect(divElements.length).toBe(2)
    })
})