Commit e47cee502fa for woocommerce

commit e47cee502fab688933c624896bb6a9cb8a84ef6d
Author: Jan Lysý <lysyjan@users.noreply.github.com>
Date:   Fri Aug 14 12:14:44 2026 +0200

    Fix missing tax rates in Analytics orders advanced filter (#67678)

    * Analytics: show all tax rates in orders advanced filter

    The Tax Rate advanced filter in Analytics fetched suggestions from
    /wc-analytics/taxes with per_page: 10 and no pagination, so stores with
    more than 10 configured tax rates could only ever discover the first 10.

    Request the endpoint's full page size (100) in both the empty and search
    branches so every configured tax rate is available in the filter.

    Fixes WOOPLUG-1941.

    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

    * Add regression test for taxes autocompleter query

    Cover both query shapes of the taxes autocompleter options(): assert
    per_page: 100 is requested with and without a search term, that the
    search param is omitted when empty and forwarded when present, and that
    it targets the /wc-analytics/taxes endpoint.

    Addresses CodeRabbit review feedback on #67678.

    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

    * Drop redundant per_page assertion in taxes autocompleter test

    The 'never caps at 10' case is already covered by the toBe('100')
    assertions on the same request, so it added no coverage.

    Addresses review feedback from @chihsuan on #67678.

    ---------

    Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

diff --git a/packages/js/components/changelog/fix-wooplug-1941-tax-rate-filter-options b/packages/js/components/changelog/fix-wooplug-1941-tax-rate-filter-options
new file mode 100644
index 00000000000..9642b5a55e1
--- /dev/null
+++ b/packages/js/components/changelog/fix-wooplug-1941-tax-rate-filter-options
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Show all applicable tax rates in the Analytics advanced filter by requesting the full page of results instead of only the first 10.
diff --git a/packages/js/components/src/search/autocompleters/taxes.tsx b/packages/js/components/src/search/autocompleters/taxes.tsx
index 1df6c05912d..dcc46b19c0d 100644
--- a/packages/js/components/src/search/autocompleters/taxes.tsx
+++ b/packages/js/components/src/search/autocompleters/taxes.tsx
@@ -17,12 +17,14 @@ const completer: AutoCompleter = {
 	name: 'taxes',
 	className: 'woocommerce-search__tax-result',
 	options( search ) {
-		const query = search
-			? {
-					search,
-					per_page: 10,
-			  }
-			: {};
+		// Request the full page (up to the `/wc-analytics/taxes` endpoint's
+		// `per_page` maximum) instead of the default of 10. The dropdown has no
+		// "load more" control, so a low page size hid most of the configured tax
+		// rates from the advanced filter.
+		const query = {
+			per_page: 100,
+			...( search ? { search } : {} ),
+		};
 		return apiFetch( {
 			path: addQueryArgs( '/wc-analytics/taxes', query ),
 		} );
diff --git a/packages/js/components/src/search/autocompleters/test/taxes.tsx b/packages/js/components/src/search/autocompleters/test/taxes.tsx
new file mode 100644
index 00000000000..8d5511400bb
--- /dev/null
+++ b/packages/js/components/src/search/autocompleters/test/taxes.tsx
@@ -0,0 +1,51 @@
+/**
+ * External dependencies
+ */
+import apiFetch from '@wordpress/api-fetch';
+import { getQueryArg } from '@wordpress/url';
+
+/**
+ * Internal dependencies
+ */
+import taxes from '../taxes';
+
+jest.mock( '@wordpress/api-fetch', () => jest.fn() );
+
+const mockedApiFetch = apiFetch as unknown as jest.Mock;
+
+describe( 'taxes autocompleter', () => {
+	beforeEach( () => {
+		mockedApiFetch.mockReset();
+		mockedApiFetch.mockResolvedValue( [] );
+	} );
+
+	const getRequestedPath = () => mockedApiFetch.mock.calls[ 0 ][ 0 ].path;
+
+	test( 'requests the full page so every applicable tax rate can be filtered (empty search)', () => {
+		taxes.options( '' );
+
+		const path = getRequestedPath();
+		expect( getQueryArg( path, 'per_page' ) ).toBe( '100' );
+	} );
+
+	test( 'requests the full page and forwards the search term', () => {
+		taxes.options( 'US' );
+
+		const path = getRequestedPath();
+		expect( getQueryArg( path, 'per_page' ) ).toBe( '100' );
+		expect( getQueryArg( path, 'search' ) ).toBe( 'US' );
+	} );
+
+	test( 'omits the search param when no term is provided', () => {
+		taxes.options( '' );
+
+		const path = getRequestedPath();
+		expect( getQueryArg( path, 'search' ) ).toBeUndefined();
+	} );
+
+	test( 'queries the analytics taxes endpoint', () => {
+		taxes.options( '' );
+
+		expect( getRequestedPath() ).toContain( '/wc-analytics/taxes' );
+	} );
+} );