diff --git a/CHANGELOG.md b/CHANGELOG.md index 52b46258..2a23f940 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## main / unreleased + +* [ENHANCEMENT] Test against jQuery 4.0.0 + ## 23.0.0 / 2026-01-07 * [FEATURE] Breaking change: Add `csv` prefix to CSV related data attributes: diff --git a/lib/client_side_validations/action_view/form_builder.rb b/lib/client_side_validations/action_view/form_builder.rb index c429b523..0bd2ed1b 100644 --- a/lib/client_side_validations/action_view/form_builder.rb +++ b/lib/client_side_validations/action_view/form_builder.rb @@ -63,7 +63,7 @@ def check_box(method, options = {}, checked_value = '1', unchecked_value = '0') end end - if ::ActionView::Helpers::FormBuilder.public_instance_methods.include?(:collection_checkboxes) + if ::ActionView::Helpers::FormBuilder.public_method_defined?(:collection_checkboxes) alias collection_checkboxes collection_check_boxes end diff --git a/package.json b/package.json index 434e1e9e..dec94f8a 100644 --- a/package.json +++ b/package.json @@ -22,20 +22,20 @@ "test": "test/javascript/run-qunit.mjs" }, "devDependencies": { - "@babel/core": "^7.28.5", - "@babel/preset-env": "^7.28.5", + "@babel/core": "^7.28.6", + "@babel/preset-env": "^7.28.6", "@rollup/plugin-babel": "^6.1.0", "@rollup/plugin-node-resolve": "^16.0.3", "chrome-launcher": "^1.2.1", "eslint": "^9.39.2", - "eslint-plugin-compat": "^6.0.2", + "eslint-plugin-compat": "^6.1.0", "neostandard": "^0.12.2", - "puppeteer-core": "^24.34.0", - "rollup": "^4.55.1", + "puppeteer-core": "^24.36.0", + "rollup": "^4.57.0", "rollup-plugin-copy": "^3.5.0" }, "peerDependencies": { - "jquery": "^3.7.1" + "jquery": "^3.7.1 || ^4.0.0" }, "main": "dist/client-side-validations.js", "module": "dist/client-side-validations.esm.js", diff --git a/test/action_view/cases/test_form_for_helpers.rb b/test/action_view/cases/test_form_for_helpers.rb index 351c88ce..eac7d310 100644 --- a/test/action_view/cases/test_form_for_helpers.rb +++ b/test/action_view/cases/test_form_for_helpers.rb @@ -457,7 +457,7 @@ def test_collection_check_boxes assert_dom_equal expected, output_buffer end - if ::ActionView::Helpers::FormBuilder.public_instance_methods.include?(:collection_checkboxes) + if ::ActionView::Helpers::FormBuilder.public_method_defined?(:collection_checkboxes) def test_collection_checkboxes form_for(@post, validate: true) do |f| concat f.collection_checkboxes(:cost, [], :id, :name) diff --git a/test/action_view/cases/test_form_with_helpers.rb b/test/action_view/cases/test_form_with_helpers.rb index cfafbd98..1b2ad42d 100644 --- a/test/action_view/cases/test_form_with_helpers.rb +++ b/test/action_view/cases/test_form_with_helpers.rb @@ -494,7 +494,7 @@ def test_form_with_collection_check_boxes assert_dom_equal expected, output_buffer end - if ::ActionView::Helpers::FormBuilder.public_instance_methods.include?(:collection_checkboxes) + if ::ActionView::Helpers::FormBuilder.public_method_defined?(:collection_checkboxes) def test_form_with_collection_checkboxes form_with(model: @post, validate: true) do |f| concat f.collection_checkboxes(:cost, [], :id, :name) diff --git a/test/javascript/server.rb b/test/javascript/server.rb index e6d498f8..d15f31f8 100644 --- a/test/javascript/server.rb +++ b/test/javascript/server.rb @@ -29,7 +29,7 @@ def call(env) use AssetPath, urls: ['/vendor/assets/javascripts'], root: File.expand_path('../..', settings.root) use AssetPath, urls: ['/vendor/assets/javascripts'], root: File.expand_path('../', $LOAD_PATH.find { |p| p.include?('jquery-rails') }) -DEFAULT_JQUERY_VERSION = '3.7.1' +DEFAULT_JQUERY_VERSION = '4.0.0' QUNIT_VERSION = '2.25.0' helpers do