score:0

import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";

describe('Expand body button', async () => {
    it('should render OrderModuleBody when clicked', () => {
        // render your component
        render(<YourComponent />) 
        // access your button
        const button = screen.getByTestId('orderModuleHeaderButton') 
        // simulate button click
        userEvent.click(button); 

        // expect result
        await waitFor(() =>  
            expect(screen.getByText("Some content")).toBeInTheDocument();
       });
}

Related Query

More Query from same tag