Skip to content

Commit e25483b

Browse files
Update JavaScript pack tag expectation in ReactOnRailsHelper spec to defer loading
- Modified the expectation for the JavaScript pack tag in the ReactOnRailsHelper spec to set the `defer` option to true, ensuring scripts are loaded in a non-blocking manner. - This change improves the performance of the component rendering process in tests.
1 parent 37a8389 commit e25483b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec/dummy/spec/helpers/react_on_rails_helper_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class PlainReactOnRailsHelper
6464
allow(helper).to receive(:append_stylesheet_pack_tag)
6565
expect { helper.load_pack_for_generated_component("component_name", render_options) }.not_to raise_error
6666

67-
expect(helper).to have_received(:append_javascript_pack_tag).with("generated/component_name", { defer: false })
67+
expect(helper).to have_received(:append_javascript_pack_tag).with("generated/component_name", { defer: true })
6868
expect(helper).to have_received(:append_stylesheet_pack_tag).with("generated/component_name")
6969
end
7070

0 commit comments

Comments
 (0)