import { toDispatchActions } from './toDispatchActions' import { toDispatchActionsInAnyOrder } from './toDispatchActionsInAnyOrder' import { toNotHaveDispatchedActions } from './toNotHaveDispatchedActions' import { toFinishAllListeners } from './toFinishAllListeners' import { toFinishListeners } from './toFinishListeners' import { toMatchValues } from './toMatchValues' import { toMount } from './toMount' import { clearHistory } from './clearHistory' import { printActions, PrintActionsOptions } from './printActions' import { delay } from './delay' import { ActionToDispatch, ExpectFunction } from '../types' import { BuiltLogic, LogicWrapper } from 'kea' export interface ExpectLogicMethods { then: (callback?: (value: any) => void | Promise) => Promise toDispatchActions: ((actions: ActionToDispatch[]) => ExpectLogicMethods) & ((logic: BuiltLogic | LogicWrapper, actions: ActionToDispatch[]) => ExpectLogicMethods) toDispatchActionsInAnyOrder: ((actions: ActionToDispatch[]) => ExpectLogicMethods) & ((logic: BuiltLogic | LogicWrapper, actions: ActionToDispatch[]) => ExpectLogicMethods) toNotHaveDispatchedActions: ((actions: ActionToDispatch[]) => ExpectLogicMethods) & ((logic: BuiltLogic | LogicWrapper, actions: ActionToDispatch[]) => ExpectLogicMethods) toFinishListeners: ((ms?: number) => ExpectLogicMethods) & ((logic: BuiltLogic | LogicWrapper, ms?: number) => ExpectLogicMethods) toFinishAllListeners: (ms?: number) => ExpectLogicMethods toMatchValues: ((values: Record) => ExpectLogicMethods) & ((logic: BuiltLogic | LogicWrapper, values: Record) => ExpectLogicMethods) toMount: (otherLogics?: BuiltLogic | LogicWrapper | (BuiltLogic | LogicWrapper)[]) => ExpectLogicMethods clearHistory: () => ExpectLogicMethods printActions: (options?: PrintActionsOptions) => ExpectLogicMethods delay: (ms: number) => ExpectLogicMethods } export const functions: Record> = { toDispatchActions, toDispatchActionsInAnyOrder, toNotHaveDispatchedActions, toFinishAllListeners, toFinishListeners, toMatchValues, toMount, clearHistory, printActions, delay, } export const operationsWithoutLogic = ['toMount', 'clearHistory', 'printActions', 'delay', 'toFinishAllListeners']