Commit 269aa3378fc for woocommerce
commit 269aa3378fc0b3e13618a9e70b4b010585858bd3
Author: Tung Du <dinhtungdu@gmail.com>
Date: Fri Sep 25 14:02:00 2026 +0700
Remove the Product Results Count registration Jest test (#69093)
Partially reverts #68662. The test mocks block registration and mostly
checks wiring; the E2E test already covers the editor placeholder. The
PHPUnit tests from #68662 are kept.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
diff --git a/plugins/woocommerce/client/blocks/assets/js/blocks/product-results-count/test/index.tsx b/plugins/woocommerce/client/blocks/assets/js/blocks/product-results-count/test/index.tsx
deleted file mode 100644
index 82ec74e98ac..00000000000
--- a/plugins/woocommerce/client/blocks/assets/js/blocks/product-results-count/test/index.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * External dependencies
- */
-import { render, screen } from '@testing-library/react';
-import { registerBlockType } from '@wordpress/blocks';
-import type { ComponentType } from 'react';
-
-/**
- * Internal dependencies
- */
-import metadata from '../block.json';
-
-jest.mock( '@wordpress/blocks', () => ( {
- registerBlockType: jest.fn(),
-} ) );
-
-jest.mock( '@wordpress/block-editor', () => ( {
- useBlockProps: ( props: Record< string, unknown > ) => props,
-} ) );
-
-type RegisteredBlock = {
- edit: ComponentType< Record< string, unknown > >;
- save: () => null;
-};
-
-const loadRegisteredBlock = (): RegisteredBlock => {
- jest.isolateModules( () => {
- jest.requireActual( '../index' );
- } );
-
- expect( registerBlockType ).toHaveBeenCalledTimes( 1 );
- const [ registeredMetadata, settings ] = ( registerBlockType as jest.Mock )
- .mock.calls[ 0 ];
-
- expect( registeredMetadata ).toEqual( metadata );
- expect( registeredMetadata.name ).toBe(
- 'woocommerce/product-results-count'
- );
- expect( settings ).not.toHaveProperty( 'attributes' );
-
- return settings as RegisteredBlock;
-};
-
-describe( 'Product Results Count block registration', () => {
- beforeEach( () => {
- jest.clearAllMocks();
- } );
-
- it( 'registers its real editor placeholder and dynamic save callback', () => {
- const { edit: Edit, save } = loadRegisteredBlock();
-
- render( <Edit /> );
-
- expect(
- screen.getByText( 'Showing 1-X of X results' )
- ).toBeInTheDocument();
- expect( save() ).toBeNull();
- } );
-} );