-
Notifications
You must be signed in to change notification settings - Fork 113
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
refactored onKeyDown to be easier to read, and added test #943
refactored onKeyDown to be easier to read, and added test #943
Conversation
…reserved behavior
Add this to the tests:
|
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.
Thanks for doing this 😄
My biggest concern stems from replicating the search-display-controller
logic in the tests because even though they verify the correctness of the current yomitan, if the logic of those if statement changes in the future, we would need to update the corresponding tests, which I don't expect future developers to remember to do.
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 would also be good to include this test in the package.json. Maybe something like this:
"test:search-display-controller": "vitest run --config test/data/vitest.search-display-controller.config.json",
With test/data/vitest.search-display-controller.config.json
looking like this:
{
"test": {
"include": [
"test/search-display-controller.test.js"
]
}
}
Then npm run test:search-display-controller
can be added to "test"
command in package.json as well.
Actually disregard the part about adding a specific script for this in the package. It's probably not important enough to need that. It runs with |
…er-keydown' into refactor/search-display-controller-keydown
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.
Thank you for taking the time to add this!
#918
Changed the onKeyDown function in search-display-controller to be easier to read. Also created a new test file to test preserved behavior between the current and new function.
The test passes, but I'm not sure if the test is up to par or not, but I tried to replicate as well as I could figure out how to.