zulip-terminal
zulip-terminal copied to clipboard
boxes: Enter on a empty string cancels the stream/user/message search.
An empty search string shows an empty search box and jumps to eg. the full selection of streams, leaving the search box blank. This caused confusion because it was an empty search.
This fix causes an empty string search for a stream/user, with enter, to now act the same as 'esc';ie. it cancels the search and returns to the full list of streams/users. For messages, it returns to the body. A test for this behavior in PanelSearchBox was also added.
Fixes: #551.
Heads up @meelanp, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/master
branch and resolve your pull request's merge conflicts accordingly.
@meelanp To get the fix in, I've tidied up your changes to boxes.py
and merged them manually with a few minor adjustments as f4dc8198044876232ca960b9aaeadf2843cbba27, since we can work on the tests separately as you develop your git skills further :tada:
I see you've got some idea of how the parametrize-ation works, but these asserts look like they're closer to those in a different test, which matches how you've coded it too. The names of existing tests can be changed, if necessary, in case that made you want to put the change in this test function instead?
We can close this and you can work on tests in another PR, or just rebase your changes and resolve the (likely minor) conflicts due to my minor changes and work on it here.
This looks like it could be closed with the adjustment/addition of tests to cover what was the new/fixed behavior.