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
While remaking the new project theme (#51159) I've noticed that unit tests for CodeEdit have some weird spatial assumptions about where to click or emulate other mouse interactions.
Two tests were failing because of that:
[CodeEdit] autocomplete completion
The size of 100 by 100 pixels is ridiculously small for a text editor control. It causes the completion panel to pop up (and not down), beyond the control area. The tests is hardcoded for this behavior, but it would be better to give it more size and assume that the panel appears within the box of the control, as it normally should.
The test also doesn't account for the completion panel having any kind of padding inside of it. As such, it can trigger the event in an area outside of the completion panel hitbox, and fail. Styling information should be used.
[SceneTree][CodeEdit] symbol lookup
Same here about the size of the control. Additionally, some arbitrary number 55 is hardcoded for an offset of the mouse click position. It is assumed that this offset would place the cursor to the exact location to match the tests data. This value will fail from a change to almost any property, both styleboxes and fonts would cause the control to render slightly differently.
Now, maybe that's the point and we have to update these tests to be rigid with the new theme (though, I'm not sure there is a good reason for that, it tests nothing this way). But to do that the tests needs to explain way better what they are attempting to do and what the assumed behavior should be. At least as comments in the code. I had to try and recreate the tests scene in a project to figure out what is happening there, and why it may be failing.
Steps to reproduce
Run tests with a slightly different default theme. See the GitHub action runs for the aforementioned PR.
Minimal reproduction project
N/a
The text was updated successfully, but these errors were encountered:
Godot version
master
System information
GitHub Actions
Issue description
While remaking the new project theme (#51159) I've noticed that unit tests for
CodeEdit
have some weird spatial assumptions about where to click or emulate other mouse interactions.Two tests were failing because of that:
The size of 100 by 100 pixels is ridiculously small for a text editor control. It causes the completion panel to pop up (and not down), beyond the control area. The tests is hardcoded for this behavior, but it would be better to give it more size and assume that the panel appears within the box of the control, as it normally should.
The test also doesn't account for the completion panel having any kind of padding inside of it. As such, it can trigger the event in an area outside of the completion panel hitbox, and fail. Styling information should be used.
Same here about the size of the control. Additionally, some arbitrary number
55
is hardcoded for an offset of the mouse click position. It is assumed that this offset would place the cursor to the exact location to match the tests data. This value will fail from a change to almost any property, both styleboxes and fonts would cause the control to render slightly differently.Now, maybe that's the point and we have to update these tests to be rigid with the new theme (though, I'm not sure there is a good reason for that, it tests nothing this way). But to do that the tests needs to explain way better what they are attempting to do and what the assumed behavior should be. At least as comments in the code. I had to try and recreate the tests scene in a project to figure out what is happening there, and why it may be failing.
Steps to reproduce
Run tests with a slightly different default theme. See the GitHub action runs for the aforementioned PR.
Minimal reproduction project
N/a
The text was updated successfully, but these errors were encountered: