You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually I am able to use screen.emitted, and it contains the entry for the emitted event and its values
for example a test like this works for me
it(`emits "delete-item" event when delete button is clicked`,async()=>{constdeleteButton=page.getByAltText("Delete Chocolate Bar");expect(deleteButton.elements().length).toBe(1);awaituserEvent.click(deleteButton);constemittedEvents=screen.emitted("delete-item");expect(emittedEvents).toBeTruthy();expect(emittedEvents.length).toBe(1);expect(emittedEvents[0][0]).toStrictEqual(sampleItems[1]);});
Is it possible to catch emitted value from a component after submit button on a form in the component is clicked?
The text was updated successfully, but these errors were encountered: