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

[11.x] Add Prompts textarea fallback for tests and add assertion tests #51055

Merged
merged 10 commits into from
Apr 15, 2024

Conversation

lioneaglesolutions
Copy link
Contributor

@lioneaglesolutions lioneaglesolutions commented Apr 14, 2024

This PR adds a fallback for the new textarea component in Laravel Prompts, similar to other components. Without this, you can not use expectsQuestion when using the textarea prompt.

Issue

I don't quite understand the underlying fallbackUsing behaviour but I do know that if it's missing, it causes the tests to hang.

Fixes

Tests

I'm not sure if the tests are the right way to go about this but it's the only way I could validate the fix in the framework. If you remove the new Textarea::fallbackUsing(...) and run the new tests, they will hang. I also found some other interesting behaviour when writing those tests but require these to be merged first before I can work on a fix.

Additional PR

If this PR is merged, can #51056 please be looked at as well?

@lioneaglesolutions
Copy link
Contributor Author

I'm not quite sure how to fix the failing tests - I think they're failing because textarea is only available in the latest version of Laravel but the matrix is checking older versions. I'm not quite sure how to fix that.

@lioneaglesolutions
Copy link
Contributor Author

I've updated the composer.json to bump the prompts version to at least get the tests passing but not sure if this should be left alone...

@jessarcher
Copy link
Member

Thanks, @lioneaglesolutions!

I've updated the fallback to use Symfony's multiline setting. It doesn't matter so much for test assertions, but the fallbacks are also used for Windows users without WSL.

@jessarcher jessarcher marked this pull request as ready for review April 15, 2024 06:26
@lioneaglesolutions
Copy link
Contributor Author

Awesome @jessarcher glad I could help. Any thoughts on #51056?

@driesvints driesvints changed the title [11.x] - add Prompts textarea fallback for tests and add assertion tests [11.x] Add Prompts textarea fallback for tests and add assertion tests Apr 15, 2024
@taylorotwell taylorotwell merged commit 61716c9 into laravel:11.x Apr 15, 2024
28 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.

None yet

3 participants