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 tests to bevy_ui::Layout #9781

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

ickshonpe
Copy link
Contributor

@ickshonpe ickshonpe commented Sep 12, 2023

Objective

Add tests for ui_layout_system and UiSurface to the bevy_ui::Layout module.

Solution

Spawn a dummy window entity with Window and PrimaryWindow components so that ui_layout_system can run in a test without a window present.


Changelog

Added tests to the bevy_ui::layout module.

@alice-i-cecile alice-i-cecile added A-UI Graphical user interfaces, styles, layouts, and widgets C-Code-Quality A section of code that is hard to understand or change labels Sep 12, 2023
Copy link
Contributor

@nicoburns nicoburns left a comment

Choose a reason for hiding this comment

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

Seems fine. My only concern is that the tests seem quite verbose and might be hard to maintain. But they can always be deleted if that turns out to be the case.

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Sep 12, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Sep 12, 2023
@alice-i-cecile
Copy link
Member

We can also pull out helper functions to use in the tests: they're a good indicator of the types of APIs we might want to expose anyways.

Merged via the queue into bevyengine:main with commit 97eda02 Sep 12, 2023
25 checks passed
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
# Objective

Add tests for `ui_layout_system` and `UiSurface` to the
`bevy_ui::Layout` module.

## Solution

Spawn a dummy window entity with `Window` and `PrimaryWindow` components
so that `ui_layout_system` can run in a test without a window present.

---

## Changelog

Added tests to the `bevy_ui::layout` module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Code-Quality A section of code that is hard to understand or change S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants