import { routes , switchRoutes } from './routes' ; describe ( 'routes spec' , ( ) => { it ( '"switchRoutes" should have expected value by default' , ( ) => { interface SwitchRoutes { root : string ; student : string ; trainer : string ; } const expectedValue = { root : '/' , student : '/student/:room' , trainer : '/trainer/:room/:token' , } ; expect ( switchRoutes ) . toEqual < SwitchRoutes > ( expectedValue ) ; } ) ; it ( '"routes.student" & "routes.trainer" should be functions by default' , ( ) => { expect ( routes . student ) . toEqual ( expect . any ( Function ) ) ; expect ( routes . trainer ) . toEqual ( expect . any ( Function ) ) ; } ) ; it ( '"routes.student" should return switchRoutes.student path with room name when called' , ( ) => { const expectedResult = '/student/new-room' ; const result = routes . student ( 'new-room' ) ; expect ( result ) . toEqual ( expectedResult ) ; } ) ; it ( '"routes.trainer" should return switchRoutes.trainer path with room name when called' , ( ) => { const expectedResult = '/trainer/new-room/new-token' ; const result = routes . trainer ( 'new-room' , 'new-token' ) ; expect ( result ) . toEqual ( expectedResult ) ; } ) ; } ) ;