-
Notifications
You must be signed in to change notification settings - Fork 117
Add placeholder parameter support to confirm prompt #486
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,3 +101,25 @@ def test_confirm_instruction(): | |
| "confirm", message, text, instruction="Foo instruction" | ||
| ) | ||
| assert result is True | ||
|
|
||
|
|
||
| def test_confirm_placeholder(): | ||
| message = "Foo message" | ||
| text = "Y" + "\r" | ||
| placeholder = "This is a placeholder" | ||
|
|
||
| result, cli = feed_cli_with_input( | ||
| "confirm", message, text, placeholder=placeholder | ||
| ) | ||
| assert result is True | ||
|
|
||
|
|
||
| def test_confirm_placeholder_disappears_on_input(): | ||
| message = "Foo message" | ||
| text = "n" + KeyInputs.ENTER + "\r" | ||
| placeholder = "This should disappear" | ||
|
|
||
| result, cli = feed_cli_with_input( | ||
| "confirm", message, text, auto_enter=False, placeholder=placeholder | ||
| ) | ||
| assert result is False | ||
|
Comment on lines
+106
to
+125
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These tests don't exercise the placeholder logic. Both only assert the y/n result, which passes regardless of whether the placeholder renders or clears. Could you assert on what's displayed: that the |
||
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.