-
Notifications
You must be signed in to change notification settings - Fork 440
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
Add test coverage for use of turbo_stream
helpers in components
#1227
Conversation
Turbo doesn't support Rails < 6 - that seems to come right down to installation, since the builds are failing on dependencies. Was Appraisal ever added to our testing setup? I seem to remember seeing talk about it in another PR. I think that'd resolve this issue. |
Yes this is still a work in progress here: #1225 Feel free to review :) |
@boardfish #1225 is merged, you can rebase and add turbo as a conditional dependency! |
61cd18c
to
ad60f96
Compare
@Spone I've tried to move things over to using Appraisal, but CI seems to be failing because it doesn't recognize |
I guess we will have to wait for #1230 (see this comment) |
We're now waiting for #1308 :) |
Ooh, thanks for the reminder about this one @reeganviljoen – in theory we're not blocked on it anymore, but it's been a long time since I last looked at it 😅 |
@Spone @boardfish @reeganviljoen any interest in taking this on, or should I close? |
I'll rebase and see where that lands us – hopefully we're able to get it merged 🤞 |
@joelhawksley i had to get investge this the other day for work reasons Tldr the tag helpers use concat wich trips up the capture |
f98eb8c
to
5938273
Compare
Looks like we're subject to hotwired/turbo-rails#74 here. That's perhaps the final blocker – the purist in me thinks it's not worth bringing Action Cable in just to get this over the line, and that the capture compatibility patch ought to fix this. But equally I'm thinking we shouldn't be encouraging folks towards that if they can avoid it. Also, while it's been a hot minute since I checked #1106, fixing this between ourselves and the |
@boardfish I'm fine adding ActionCable to our test stack as it's present in a lot of Rails apps ❤️ |
Awesome, I'll do that next – I expect that to get this passing. I might see if I can contribute to |
0d5d58f
to
b2795ec
Compare
Alright, all set! We now require Action Cable in the sandbox app so that the Turbo Stream tag helper works. I also found that because of the age of this PR there was still some support for Rails versions we don't test against kicking around, so I got rid of that. |
turbo_stream
helpers in components
Summary
Replicates #1137 with the aim of supporting #1106.
Other Information
I'm not sure how to get this test to pass. I've tried using
helpers.tag.turbo_stream
andhelpers.tag.template
too, but neither seems to change the output.Desired output (whitespace formatted for readability):
Actual output (whitespace formatted for readability):
Regardless of whether
helpers.tag.turbo_stream
orturbo_stream.update
is used, what seems to be happening is that the block that is received is concatenated to the view as normal, then done again without being marked ashtml_safe
within the tags.Implementation of the
turbo_stream
tag builder starts around here.This is the object returned by callingturbo_stream
against the view.