Skip to content

Component Testing - How to trap event emit by component #3808

@mariocardinal

Description

@mariocardinal

I'm submitting a request for a script example

I need to understand how I can trap the event emitted by a component. For example, let say I have a component with a button and when button is clicked it emit an event. I know how to automate click using cy.click() but how do I verify that the event was emit by the button.

[ ] Bug report
[ x] Content update
[ ] Process update (build, deployment, ... )


## Type of bug / changes

Add a section in Component Testing documentation about trapping component's event

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions