Fire Event .context Menu Click won't work #1671
Replies: 2 comments 1 reply
-
@DhineshBabuH your question contains too few information for anybody to help you. Please describe your challenge clearly and present relevant (focused) code. |
Beta Was this translation helpful? Give feedback.
-
@mdjastrzebski sir, that issue was resolved i have this new issue, import { render, screen } from '@testing-library/react'; test('should handle mouse events correctly', async () => { // Render the component with a mock handleKeyPress // Get the resize handle await userEvent.pointer([{ keys: '[MouseLeft]', target: resizeHandle }]); expect(handleKeyPress).toHaveBeenCalled(); the event stimulates perfect but i got the
Expected Call: The test checks that handleKeyPress was called at least once during the execution of the simulated mouse event. Received Call Count: The actual call count of handleKeyPress was 0, meaning the function was never invoked during the test.
|
Beta Was this translation helpful? Give feedback.
-
Ask your Question
Hi,
I am working on righting test cases for my project so i need to write a test for ContextMenu click so if i have html element and then i if i passed that element to fireEvent.contextMenu(HTMLELement) it won't work so now what do i do ?
Beta Was this translation helpful? Give feedback.
All reactions