Skip to content

Commit 3ed127f

Browse files
ihabadhamclaude
andauthored
Fix integration tests for immediate_hydration Pro license changes (#1783)
* Fix integration tests for immediate_hydration Pro license changes Mock Pro license validation per-test using around blocks. Follows existing helper spec patterns. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * linting * DRY * linting --------- Co-authored-by: Claude <[email protected]>
1 parent f7d5355 commit 3ed127f

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

spec/dummy/spec/system/integration_spec.rb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,24 @@ def finished_all_ajax_requests?
8686
include_examples "React Component", "div#my-hello-world-id"
8787
end
8888

89+
shared_context "with pro features and immediate hydration" do
90+
before do
91+
allow(ReactOnRails::Utils).to receive(:react_on_rails_pro_licence_valid?).and_return(true)
92+
end
93+
94+
around do |example|
95+
ReactOnRails.configure { |config| config.immediate_hydration = true }
96+
example.run
97+
ReactOnRails.configure { |config| config.immediate_hydration = false }
98+
end
99+
end
100+
89101
describe "Turbolinks across pages", :js do
90102
subject { page }
91103

104+
include_context "with pro features and immediate hydration"
105+
92106
it "changes name in message according to input" do
93-
skip "Flaky test - needs investigation"
94107
visit "/client_side_hello_world"
95108
expect_change_text_in_dom_selector("#HelloWorld-react-component-0")
96109
click_on "Hello World Component Server Rendered, with extra options"
@@ -101,8 +114,9 @@ def finished_all_ajax_requests?
101114
describe "TurboStream send react component", :js do
102115
subject { page }
103116

117+
include_context "with pro features and immediate hydration"
118+
104119
it "force load hello-world component immediately" do
105-
skip "Flaky test - needs investigation"
106120
visit "/turbo_frame_tag_hello_world"
107121
click_on "send me hello-turbo-stream component"
108122
expect(page).to have_text "Hello, Mrs. Client Side Rendering From Turbo Stream!"

0 commit comments

Comments
 (0)