import { createTogglePhaseAction } from '../../helpers' ; import { initTestBed } from '../init_test_bed' ; import { Phase } from '../../../../common/types' ; type SetupReturn = ReturnType < typeof setupTimelineTestBed > ; export type TimelineTestBed = SetupReturn extends Promise < infer U > ? U : SetupReturn ; export const setupTimelineTestBed = async ( ) => { const testBed = await initTestBed ( ) ; const { exists } = testBed ; return { ... testBed , actions : { togglePhase : createTogglePhaseAction ( testBed ) , timeline : { hasPhase : ( phase ) => exists ( `ilmTimelinePhase-${ phase }` ) , } , } , } ; } ;