Skip to content

Add assert in test live component #2712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

Arkalo2
Copy link

@Arkalo2 Arkalo2 commented May 5, 2025

Q A
Bug fix? no
New feature? yes
Docs? yes
Issues no
License MIT

This MR simplify liveComponent event testing :
Actually with the Test Helper, we can't simply test whether an event has been dispatched from a component.
This PR add 2 asserts :

$this->componentHasEmittedEvent($render, 'event-name', [
    'eventArg1' => $eventArg1,
]);
$this->assertComponentNotEmitEvent($render, 'event-name');
@carsonbot carsonbot added Bug Bug Fix Feature New Feature Status: Needs Review Needs to be reviewed labels May 5, 2025
@Arkalo2 Arkalo2 marked this pull request as draft May 5, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug Fix Feature New Feature Status: Needs Review Needs to be reviewed
2 participants