Created
          April 5, 2017 18:52 
        
      - 
      
 - 
        
Save carlosble/fac838dbdcd2d7afe509828d77d6d404 to your computer and use it in GitHub Desktop.  
    Asserting agains the store
  
        
  
    
      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
    
  
  
    
  | beforeEach(function () { | |
| spyRouter = { push: jest.fn() }; | |
| initialState = {profile: {id: '123456789H'}}; | |
| store = configureStore(initialState); | |
| }); | |
| it("clears store's state on logout", (done) => { | |
| expect(store.getState().profile.id).toEqual(initialState.profile.id); | |
| store.subscribe(() => { | |
| expect(store.getState().profile.id).toEqual(''); | |
| done(); | |
| }); | |
| mountLogoutPage(); | |
| }); | |
| function mountLogoutPage() { | |
| let LogoutPage = createLogoutPage(); | |
| mount( | |
| <Provider store={store}> | |
| <LogoutPage router={spyRouter} /> | |
| </Provider>); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment