-
Notifications
You must be signed in to change notification settings - Fork 8
Conversation
a1531c0
to
022185e
Compare
I don't mind if you won't review JSON files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice initiative 👍
(Not tested yet).
ab540ff
to
ec7f3a6
Compare
Writing your own unit test would be a great way to test this PR ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love that now we can test the step inspector! 👌
The following tests fail:
RenameTest
Test RenameTest failed: NUnit.Framework.AssertionException: Expected string length 9 but was 4. Strings differ at index 0.
Expected: "New Step!"
But was: "Test"
- `CopyOneStepWithHotkeysTest``
Test CopyOneStepWithHotkeysTest failed: NUnit.Framework.AssertionException:
Expected: 2
But was: 1
I tried to re-record them but I got the same result.
Nice to have
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests pass now! ❤️
try | ||
{ | ||
BaseWhen(result); | ||
BaseThen(result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about enabling BaseThen
to be yielded? That could allow more complex assertions. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you give me example? I can't think of anything that would justify the complexity. Also, we can always do it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, it does not have to be done now.
But for example, there could be a case where we need to wait until something it is applied (perhaps a frame), yielding the BaseThen would allow us to yield null or WaitUntil
.
A potential scenario: a test where a behavior or condition that requires a property is just added to a step, then a new game object is added as a parameter and the "Fix Button" is pressed. We might want to wait for a frame to ensure the required components were added.
@@ -268,7 +263,7 @@ private void DrawTestView(IEditorImguiTest test) | |||
EditorGUILayout.EndHorizontal(); | |||
} | |||
|
|||
private void DrawTestStateIndicator(Vector2 position, TestState state) | |||
private static void DrawTestStateIndicator(Vector2 position, TestState state) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a private helper method that does not use anything from the calling instance. No reason to keep it instance method.
Tested on my machine & works. |
f253675
to
97c8069
Compare
🎉 This PR is included in version 2.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description
Fixes dropdown menu testing by removing a weird piece of code. I don't know why it was there in the first place. It could or could not bite us some time later.
Fixes hotkeys testing by not recording Unity command event that immediately follows hotkey event (otherwise, the hotkey event plays and triggers, say, Paste, then Paste event plays so you get things pasted twice).
Adds a first test for StepWindow to build upon in future.
Type of change
How Has This Been Tested?
I ran tests and they are green. I ran tests on develop and they are red.
Checklist