From a7ac0810095fe41405170dc85e36c55a57b09f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Mon, 18 Aug 2025 22:12:36 +0200 Subject: [PATCH 1/2] Tests: Make tests not trigger Migrate 4.0.0-beta.1 warnings Changes: * Checkboxradio: Change `.attr( "checked", true )` to `.attr( "checked", "checked" ) * Selectmenu: Disable the `boolean-attributes` patch for one assertion where it's impossible to avoid Closes gh-2364 --- tests/unit/checkboxradio/options.js | 2 +- tests/unit/selectmenu/methods.js | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/tests/unit/checkboxradio/options.js b/tests/unit/checkboxradio/options.js index e2869ddbdc9..f573b472935 100644 --- a/tests/unit/checkboxradio/options.js +++ b/tests/unit/checkboxradio/options.js @@ -97,7 +97,7 @@ QUnit.test( "icon - default unchecked", function( assert ) { } ); QUnit.test( "icon - default checked", function( assert ) { - var checkbox = $( "#checkbox-option-icon" ).attr( "checked", true ); + var checkbox = $( "#checkbox-option-icon" ).attr( "checked", "checked" ); assert.expect( 2 ); diff --git a/tests/unit/selectmenu/methods.js b/tests/unit/selectmenu/methods.js index f2506f2d300..52e31cbd4f7 100644 --- a/tests/unit/selectmenu/methods.js +++ b/tests/unit/selectmenu/methods.js @@ -41,8 +41,25 @@ QUnit.test( "enable / disable", function( assert ) { element.selectmenu( "disable" ); assert.ok( element.selectmenu( "option", "disabled" ), "disable: widget option" ); - assert.ok( [ "disabled", "" ].indexOf( element.attr( "disabled" ) ) !== -1, - "disable: native select disabled" ); + + // Migrate 4.x warns about reading boolean attributes when their + // value is not their lowercase name - but that's what happens + // when setting the `disabled` property to `true` first; the attribute + // is then set to an empty string. Avoid the warning by temporarily + // disabling the patch. + // In real apps it's discouraged to mix `.prop()` & `.attr()` usage + // for reflected property-attribute pairs. + if ( $.migrateDisablePatches ) { + $.migrateDisablePatches( "boolean-attributes" ); + } + assert.ok( + [ "disabled", "" ].indexOf( element.attr( "disabled" ) ) !== -1, + "disable: native select disabled" + ); + if ( $.migrateEnablePatches ) { + $.migrateEnablePatches( "boolean-attributes" ); + } + assert.equal( button.attr( "aria-disabled" ), "true", "disable: button ARIA" ); assert.equal( button.attr( "tabindex" ), -1, "disable: button tabindex" ); assert.equal( menu.attr( "aria-disabled" ), "true", "disable: menu ARIA" ); From beac2ea401e2ef6c85ac22fa08a56c73fcab89a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Mon, 18 Aug 2025 23:13:50 +0200 Subject: [PATCH 2/2] Build: Fix tests on Edge There was a typo in the test command for Edge on Windows - a double `--`. This worked with npm included with Node.js 22.17.1, but started failing with 22.18.0. Closes gh-2367 --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index cccd059d28e..d7244782ebc 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -98,7 +98,7 @@ jobs: run: npm run build - name: Test - run: npm run test:unit -- -- --headless -b edge -c ${{ matrix.CONFIGS.config }} + run: npm run test:unit -- --headless -b edge -c ${{ matrix.CONFIGS.config }} safari: runs-on: macos-latest