Skip to content

Commit de4d34b

Browse files
committed
remove pro-specific tests from basic integration spec
1 parent aaae2d0 commit de4d34b

File tree

2 files changed

+1
-53
lines changed

2 files changed

+1
-53
lines changed

packages/react-on-rails/src/pageLifecycle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ function onPageReady(callback: () => void) {
7070
callback();
7171
} else {
7272
document.addEventListener('readystatechange', function onReadyStateChange() {
73-
onPageReady(callback);
7473
document.removeEventListener('readystatechange', onReadyStateChange);
74+
onPageReady(callback);
7575
});
7676
}
7777
}

spec/dummy/spec/system/integration_spec.rb

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -86,58 +86,6 @@ 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_messages(
92-
react_on_rails_pro?: true,
93-
react_on_rails_pro_version: "",
94-
rsc_support_enabled?: false
95-
)
96-
97-
# Stub ReactOnRailsPro::Utils.pro_attribution_comment for all tests
98-
# since react_on_rails_pro? is set to true by default
99-
pro_module = Module.new
100-
utils_module = Module.new do
101-
def self.pro_attribution_comment
102-
"<!-- Powered by React on Rails Pro (c) ShakaCode | Licensed -->"
103-
end
104-
end
105-
stub_const("ReactOnRailsPro", pro_module)
106-
stub_const("ReactOnRailsPro::Utils", utils_module)
107-
end
108-
109-
around do |example|
110-
ReactOnRails.configure { |config| config.immediate_hydration = true }
111-
example.run
112-
ReactOnRails.configure { |config| config.immediate_hydration = false }
113-
end
114-
end
115-
116-
describe "Turbolinks across pages", :js do
117-
subject { page }
118-
119-
include_context "with pro features and immediate hydration"
120-
121-
it "changes name in message according to input" do
122-
visit "/client_side_hello_world"
123-
expect_change_text_in_dom_selector("#HelloWorld-react-component-0")
124-
click_on "Hello World Component Server Rendered, with extra options"
125-
expect_change_text_in_dom_selector("#my-hello-world-id")
126-
end
127-
end
128-
129-
describe "TurboStream send react component", :js do
130-
subject { page }
131-
132-
include_context "with pro features and immediate hydration"
133-
134-
it "force load hello-world component immediately" do
135-
visit "/turbo_frame_tag_hello_world"
136-
click_on "send me hello-turbo-stream component"
137-
expect(page).to have_text "Hello, Mrs. Client Side Rendering From Turbo Stream!"
138-
end
139-
end
140-
14189
describe "Pages/client_side_log_throw", :ignore_js_errors, :js do
14290
subject { page }
14391

0 commit comments

Comments
 (0)