import { expectTypeOf } from 'expect-type'; import { AsyncFlow, AsyncFlowWithCache, AsyncFlowWithData, AsyncFlowWithDataAndCache, IdName, LabelValue, } from './common'; describe('AsyncFlow', () => { it('should match properly', () => { expectTypeOf({ message: 'test', status: 'IDLE' as const, }).toMatchTypeOf(); }); }); describe('AsyncFlowWithData', () => { it('should match properly', () => { expectTypeOf({ data: { a: 1 }, message: 'test', status: 'IDLE' as const, }).toMatchTypeOf(); }); }); describe('AsyncFlowWithCache', () => { it('should match properly', () => { expectTypeOf({ message: 'test', status: 'IDLE' as const, updatedAt: 123456789, }).toMatchTypeOf(); }); }); describe('AsyncFlowWithDataAndCache', () => { it('should match properly', () => { expectTypeOf({ data: { a: 1 }, message: 'test', status: 'IDLE' as const, updatedAt: 123456789, }).toMatchTypeOf(); }); }); describe('IdName', () => { it('should match properly', () => { expectTypeOf({ id: 'test', name: 'test', }).toMatchTypeOf(); }); }); describe('LabelValue', () => { it('should match properly', () => { expectTypeOf({ label: 'Test', value: 'test', }).toMatchTypeOf(); }); });