Commit 14936b6e2aa for woocommerce

commit 14936b6e2aa0229f6efb7e7321ab407c37909717
Author: Daniel Mallory <daniel.mallory@automattic.com>
Date:   Mon Jun 8 14:19:03 2026 +0100

    Add settings UI flag-off smoke test (#65490)

    * test: add settings ui flag-off smoke

    * Polish settings UI flag-off smoke test

diff --git a/plugins/woocommerce/changelog/add-settings-ui-flag-off-smoke b/plugins/woocommerce/changelog/add-settings-ui-flag-off-smoke
new file mode 100644
index 00000000000..5acedc58f3b
--- /dev/null
+++ b/plugins/woocommerce/changelog/add-settings-ui-flag-off-smoke
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Add a smoke test for the settings UI feature flag off state.
diff --git a/plugins/woocommerce/tests/e2e-pw/tests/settings/settings-ui-feature-flag.spec.ts b/plugins/woocommerce/tests/e2e-pw/tests/settings/settings-ui-feature-flag.spec.ts
new file mode 100644
index 00000000000..75662348da6
--- /dev/null
+++ b/plugins/woocommerce/tests/e2e-pw/tests/settings/settings-ui-feature-flag.spec.ts
@@ -0,0 +1,55 @@
+/**
+ * Internal dependencies
+ */
+import { expect, test, tags, request } from '../../fixtures/fixtures';
+import { ADMIN_STATE_PATH } from '../../playwright.config';
+import { setFeatureFlag, resetFeatureFlags } from '../../utils/features';
+import { setOption } from '../../utils/options';
+
+const getBaseURL = ( baseURL: string | undefined ): string => {
+	if ( ! baseURL ) {
+		throw new Error( 'Expected baseURL to be configured.' );
+	}
+
+	return baseURL;
+};
+
+test.describe( 'Settings UI feature flag', { tag: tags.NOT_E2E }, () => {
+	test.use( { storageState: ADMIN_STATE_PATH } );
+
+	test.beforeEach( async ( { baseURL } ) => {
+		const url = getBaseURL( baseURL );
+
+		await setFeatureFlag( request, url, 'settings-ui', false );
+		await setOption( request, url, 'woocommerce_enable_reviews', 'yes' );
+	} );
+
+	test.afterAll( async ( { baseURL } ) => {
+		const url = getBaseURL( baseURL );
+
+		await resetFeatureFlags( request, url );
+		await setOption( request, url, 'woocommerce_enable_reviews', 'yes' );
+	} );
+
+	test( 'does not mount the settings UI when the feature flag is disabled', async ( {
+		page,
+	} ) => {
+		await page.goto( 'wp-admin/admin.php?page=wc-settings&tab=products' );
+
+		await expect(
+			page.locator( '#woocommerce_enable_reviews' )
+		).toBeVisible();
+		await expect( page.locator( '[data-wc-settings-ui]' ) ).toHaveCount(
+			0
+		);
+		await page.locator( '#woocommerce_enable_reviews' ).uncheck();
+		await page.getByRole( 'button', { name: 'Save changes' } ).click();
+
+		await expect( page.locator( 'div.updated.inline' ) ).toContainText(
+			'Your settings have been saved.'
+		);
+		await expect(
+			page.locator( '#woocommerce_enable_reviews' )
+		).not.toBeChecked();
+	} );
+} );