Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to generate an onclose jest

      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');
 
PREVIOUS NEXT
Tagged: #generate #onclose #jest
ADD COMMENT
Topic
Name
8+5 =