codedamn

Test: Fire Events & User Events

Created by Shubham Sarda about 2 months ago

0

An interactive lab from the React Testing Library & Jest - Crash Course course.

1 Comment

    0

    i just want to point out that my counter component is working asynchrounos but why , i have use same exact code provided , Regardless of that i converted expect into await due to delay in input from userEvent

            userEvent.type(textArea, "Pranshu");
            // expect(charLength).toHaveTextContent("Character: 7");
            // expect(wordLength).toHaveTextContent("Word: 1");
            await waitFor(() => {
                expect(charLength).toHaveTextContent("Character: 7");
                expect(wordLength).toHaveTextContent("Word: 1");
            });
    
    
    @pranshubasak

    Pranshu Basak

    @pranshubasak

Your comment