From c2c0bbdb39586ede1035a74ed0ef9fea05cf715b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Su=C3=A1rez?= Date: Tue, 18 Jun 2024 17:53:59 +0200 Subject: [PATCH] fix ts issue --- packages/js/data/src/crud/test/actions.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/js/data/src/crud/test/actions.ts b/packages/js/data/src/crud/test/actions.ts index abcdc518506..8c6417c06a5 100644 --- a/packages/js/data/src/crud/test/actions.ts +++ b/packages/js/data/src/crud/test/actions.ts @@ -2,6 +2,7 @@ * External dependencies */ import { apiFetch } from '@wordpress/data-controls'; +import { AnyAction } from 'redux'; /** * Internal dependencies @@ -11,6 +12,15 @@ import TYPES from '../action-types'; import { cleanQuery, getRestPath, getUrlParameters } from '../utils'; import type { Item } from '../types'; +interface RequestAction { + type: string; + query: Record< string, any >; // eslint-disable-line @typescript-eslint/no-explicit-any + options?: { + optimisticPropagation?: boolean; + tempId?: string; + }; +} + const selectors = createDispatchActions( { resourceName: 'Product', namespace: '/products', @@ -104,7 +114,7 @@ describe( 'crud actions', () => { } ); } ); - it( 'with optimistc propagation', async () => { + it( 'with optimistic propagation', async () => { const query = { name: 'Zuri', kind: 'dog', @@ -117,7 +127,10 @@ describe( 'crud actions', () => { } ); // Step through the generator request action - const { value: requestAction } = generator.next(); + const { value: requestAction } = generator.next() as IteratorResult< + RequestAction, + AnyAction + >; expect( requestAction.type ).toEqual( TYPES.CREATE_ITEM_REQUEST ); expect( requestAction.query ).toEqual( {