import * as React from "react"; import { Middleware, Store } from "redux"; import { TRenderResult, Wrapper } from "./Wrapper.js"; import { DeepPartial } from "../types.js"; type TResultWithStore
= TRenderResult
& {
store: Store ;
/**
* Resets the Redux action history
*/
resetReduxHistory: () => void;
/**
* The beforeRender hook.
*
* This sets the instance of the Redux store used by the current test scenario.
*/
protected beforeRender: () => void;
/**
* The middleware for keeping track of actions that were dispatched during the test scenario lifecycle
*/
protected reduxHistoryMiddleware: Middleware;
/**
* The component to wrap the component you're testing - provides the Redux `Provider` component
*/
protected WrappingComponent: React.FC;
};
/**
* A class to provide a simple method of setting up your React component tests for apps that use Redux.
*/
export declare abstract class WrapperWithRedux;
/**
* An array of all actions dispatched during the test scenario lifecycle
*/
protected dispatchedActions: any[];
/**
* The Redux store state specific to the current test scenario.
*
* This is set by the `.withReduxState()` method and cleared after `.mount()` is called.
*/
protected scenarioReduxState: DeepPartial;
/**
* The Redux store instance.
*
* This is set during the `.beforeRender()` hook.
*/
protected reduxStore: Store | undefined;
/**
* Returns an array of all actions that were dispatched during the test scenario lifecycle
*/
get reduxHistory(): any[];
/**
* Returns the merged Redux store state used by the current test scenario
*/
protected get mergedReduxState(): S;
/**
* Toggles whether to merge arrays in the Redux state
*
* @param value The new value
*/
withMergedReduxArrays: (value: boolean) => this;
/**
* Sets the default Redux store state used by all test scenarios for the current test suite.
*
* This method can be chained with other methods.
*
* @param state The partial Redux store state to set
*/
withDefaultReduxState: (state: DeepPartial) => this;
/**
* Sets the Redux store state used by the current test scenario.
*
* This method can be chained with other methods.
*
* @param state The partial Redux store state to set
*/
withReduxState: (state: DeepPartial) => this;
/**
* Renders the component using the `render` function from `react-testing-library`.
*
* Returns the `RenderResult` from `render()`, with `store` included.
*/
render: () => TResultWithStore, middlewares: Middleware[]): Store;
}
export {};