Skip to content
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

Fix: Open editor with default value #1406

Merged
merged 3 commits into from
May 17, 2024
Merged

Fix: Open editor with default value #1406

merged 3 commits into from
May 17, 2024

Conversation

mensah-j
Copy link
Contributor

Description

Fixes #1405, reverting the bugs introduced in 8328d65 (the editor opens without defaults, and Inquirer renders text on top of in-terminal editors such as vi).

Changes Made

The editor now opens only after this.currentText has been set, and the initial render does not occur if waitUserInput is false.

Testing

The previous tests for the editor prompt do not make use of the default property set in the editor fixture. The message written to the temporary file and its expected contents are turned into test parameters message and expectedAnswer, respectively. Two additional test cases are added in which the test editor writeBin is called without the final argument (message = ''), which should leave the contents of the file untouched.

Copy link

codecov bot commented May 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@27d1c0a). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1406   +/-   ##
=======================================
  Coverage        ?   96.89%           
=======================================
  Files           ?       54           
  Lines           ?     4990           
  Branches        ?      825           
=======================================
  Hits            ?     4835           
  Misses          ?      147           
  Partials        ?        8           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SBoudrias
Copy link
Owner

Thanks for sending a fix!!

@SBoudrias SBoudrias merged commit 303f4a1 into SBoudrias:main May 17, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default value for editor prompt not written to file (old API)
2 participants