Created
September 27, 2017 21:12
-
-
Save jaredlockhart/2effe453a2a9efa496f1a8f4d7d443fc 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
48 it('should send experiment to normandy and send accept to experimenter', async () => { | |
49 const store = mockStore({ | |
50 app: {requests: {get: () => ({})}}, | |
51 }); | |
52 | |
53 const experiment = ExperimentFactory.build(); | |
54 const recipeResponse = createRecipeResponse(experiment); | |
55 | |
56 fetchMock.mock('/api/v2/recipe/', createRecipeResponse, {method: 'POST'}); | |
57 fetchMock.mock(experiment.accept_url, 'accepted', {method: 'PATCH'}); | |
58 | |
59 await store.dispatch(importExperiment(experiment)); | |
60 | |
61 const actions = new Set(store.getActions().map(action => action.type)); | |
62 expect(actions.has(EXPERIMENT_ACCEPTED)).toBeTruthy(); | |
63 expect(actions.has(RECIPE_RECEIVE)).toBeTruthy(); | |
64 console.log('more actions', store.getActions()); | |
65 }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment