como gerar uma piada onclose

      const spyFunction = jest.spyOn(helpers, "functionbeingspiedon");
      fireEvent.keyDown(container.getByText('text from element'), {
        key: "Escape",
        code: "Escape",
        keyCode: 27,
        charCode: 27
      });

      expect(spyFunction).toBeCalledWith('called parameters');
Lonely Lizard