import { AppState } from '../../modules/App/types' import * as SUT from './transforms' describe('appTransform', () => { const { appTransform } = SUT let appState: AppState beforeEach(() => { appState = { loaded: true, loading: true, } }) describe('in', () => { it('should return the state that was passed in if in is called', () => { // given ... we have a walletAddress Transform // when ... we call the in function const result = appTransform.in(appState, 'app', appState) // then .. it should return what was passed in. expect(result).toEqual(appState) }) }) describe('out', () => { it('should change the loading and loaded property of state to false', () => { // given ... we have an appTransform Transform and some state with loading and loaded set to true // when ... we call the in function const result = appTransform.out(appState, 'app', appState) // then .. it should return the state with with loading and loaded set to false. expect(result).toEqual({ loaded: false, loading: false, }) }) }) })