Skip to content

Commit 67b2ffc

Browse files
revert this: making some variations to the streaming tests to check the source of the failure
1 parent 2b5bab8 commit 67b2ffc

File tree

5 files changed

+366
-2
lines changed

5 files changed

+366
-2
lines changed

react_on_rails_pro/spec/dummy/client/app/ror-auto-load-components/AsyncComponentsTreeForTesting.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import HydrationStatus from '../components/HydrationStatus';
55
const AsyncComponentsBranch = ({ branchName, level }) => {
66
const buildResult = () => {
77
console.log(`${branchName} (level ${level})`);
8-
console.error('Error message', { branchName, level });
8+
// console.error('Error message', { branchName, level });
99
if (level === 0) {
1010
return <div>{`${branchName} (level 0)`}</div>;
1111
}

react_on_rails_pro/spec/dummy/config/initializers/react_on_rails_pro.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# If true, then cache the evaluation of JS for prerendering using the standard Rails cache.
2929
# Applies to all rendering engines.
3030
# Default for `prerender_caching` is false.
31-
config.prerender_caching = true
31+
config.prerender_caching = false
3232

3333
# Retry request in case of time out on the node-renderer side
3434
# 0 - no retry

react_on_rails_pro/spec/dummy/spec/support/selenium_logger.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,18 @@
2929

3030
raise("JavaScript Error(s) on the page:\n\n#{errors.join("\n")}") if cleaned_errors.present?
3131
end
32+
33+
config.after(:each, type: :system, js: true) do
34+
errors = page.driver.browser.logs.get(:browser)
35+
if errors.present?
36+
aggregate_failures 'javascript errrors' do
37+
errors.each do |error|
38+
expect(error.level).not_to eq('SEVERE'), error.message
39+
next unless error.level == 'WARNING'
40+
STDERR.puts 'WARN: javascript warning'
41+
STDERR.puts error.message
42+
end
43+
end
44+
end
45+
end
3246
end

react_on_rails_pro/spec/dummy/spec/system/integration_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,11 @@ def rsc_payload_fetch_requests
571571
describe "Pages/server_router", :js do
572572
subject { page }
573573

574+
it "renders /server_router/simple-server-component properly" do
575+
navigate_with_streaming("/server_router/simple-server-component")
576+
expect_client_component_inside_server_component_hydrated(page)
577+
end
578+
574579
it "navigates between pages" do
575580
navigate_with_streaming("/server_router/simple-server-component")
576581
expect_client_component_inside_server_component_hydrated(page)
@@ -608,6 +613,15 @@ def rsc_payload_fetch_requests
608613
expect(page).not_to have_text("Loading branch1 at level 1...")
609614
expect(page).not_to have_text("Loading branch1 at level 3...")
610615
end
616+
617+
it "renders /server_router/streaming-server-component with no errors" do
618+
visit("/server_router/simple-server-component")
619+
click_link "Server Component with visible streaming behavior"
620+
621+
sleep 4
622+
expect(page).to have_text("branch2 (level 0)")
623+
expect(page).to have_text(/HydrationStatus\: (Page loaded|Hydrated)/)
624+
end
611625
end
612626

613627
def async_on_server_sync_on_client_client_render_logs

0 commit comments

Comments
 (0)