diff --git a/spec/dummy/spec/system/integration_spec.rb b/spec/dummy/spec/system/integration_spec.rb index 1879dad784..b238fe302e 100644 --- a/spec/dummy/spec/system/integration_spec.rb +++ b/spec/dummy/spec/system/integration_spec.rb @@ -86,11 +86,24 @@ def finished_all_ajax_requests? include_examples "React Component", "div#my-hello-world-id" end +shared_context "with pro features and immediate hydration" do + before do + allow(ReactOnRails::Utils).to receive(:react_on_rails_pro_licence_valid?).and_return(true) + end + + around do |example| + ReactOnRails.configure { |config| config.immediate_hydration = true } + example.run + ReactOnRails.configure { |config| config.immediate_hydration = false } + end +end + describe "Turbolinks across pages", :js do subject { page } + include_context "with pro features and immediate hydration" + it "changes name in message according to input" do - skip "Flaky test - needs investigation" visit "/client_side_hello_world" expect_change_text_in_dom_selector("#HelloWorld-react-component-0") click_on "Hello World Component Server Rendered, with extra options" @@ -101,8 +114,9 @@ def finished_all_ajax_requests? describe "TurboStream send react component", :js do subject { page } + include_context "with pro features and immediate hydration" + it "force load hello-world component immediately" do - skip "Flaky test - needs investigation" visit "/turbo_frame_tag_hello_world" click_on "send me hello-turbo-stream component" expect(page).to have_text "Hello, Mrs. Client Side Rendering From Turbo Stream!"