Skip to content
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

Add unit test to check if the button was pressed #102947

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

johnsonlei1
Copy link

part of issue: #43440
adding on to unit test: #93381

This PR request adds unit tests that checks if a button can be clicked.

@johnsonlei1 johnsonlei1 requested a review from a team as a code owner February 17, 2025 11:46
@johnsonlei1
Copy link
Author

ok sorry i think i fixed the formatting this time

@AThousandShips AThousandShips requested a review from a team February 20, 2025 17:30
Comment on lines +62 to +64
// Move mouse back onto the button.
SEND_GUI_MOUSE_MOTION_EVENT(Point2i(25, 25), MouseButtonMask::NONE, Key::NONE);
CHECK(button->is_hovered() == true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of this test? Hovering is tested above, moving the cursor back won't produce a different result.

@KoBeWi
Copy link
Member

KoBeWi commented Feb 20, 2025

The test looks fine, but it's very minimal.
There's more to pressing than just pressed and released event. There is action_mode, keep_pressed_outside, button_mask...
Though maybe additional tests can be added later, idk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants