Created
August 28, 2017 15:37
-
-
Save adrianfaciu/7094f08d13930fb925e9fea04c1c083e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('app state effects', () => { | |
it('can fetch data with args from state', () => { | |
const source = cold('a', { a: { type: actions.DATA_WITH_STATE_FETCH } }); | |
const storeStub = getStoreStub(); | |
const effect = new AppStateEffect(new Actions(source), storeStub); | |
const expected = cold('a', { a: { type: actions.DATA_WITH_STATE_FETCH_SUCCESS } }); | |
expect(effect.fetchDataWithState$).toBeObservable(expected); | |
}); | |
function getStoreStub(): any { | |
const initialAppState = reducer(undefined, { type: 'INIT_ACTION' }); | |
return { | |
select: (selector) => Observable.of(selector(initialAppState)) | |
}; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment