import configureMockStore from 'redux-mock-store'
import thunk from 'redux-thunk'
import * as actions from 'actions'
const middlewares = [thunk]
const mockStore = configureMockStore(middlewares)

describe('Auth actions', () => {

    // With Travic-ci we can test only actions that make requests to remote json APIs
    // You can uncomment tests below and test it locally

    it('creates LOGIN_AUTH_SUCCESS when LOGIN_AUTH was successful', (done) => {

        const expectedActions = {
            type: actions.LOGIN_AUTH_SUCCESS,
            result: {}
        }

        const store = mockStore({})
        return store.dispatch(actions.LOGIN_AUTH({})).then((res) => {
            expect(res).toEqual(expectedActions)
            done()
        })
    })

    it('creates LOGIN_AUTH_FAIL when LOGIN_AUTH was failed', (done) => {

        const expectedActions = {
            type: actions.LOGIN_AUTH_FAIL,
            error: {}
        }

        const store = mockStore({})
        return store.dispatch(actions.LOGIN_AUTH({})).then((res) => {
            expect(res).toEqual(expectedActions)
            done()
        })
    })
})

@@ -227,152 +227,8 @@
  %7B%0A%0A
-    // With Travic-ci we can test only actions that make requests to remote json APIs%0A    // You can uncomment tests below and test it locally%0A%0A
     
@@ -295,32 +295,32 @@
 l', (done) =%3E %7B%0A
+
 %0A        const e
@@ -610,24 +610,64 @@
 %0A    %7D)%0A%0A   
+ // JSON DB should handle it too.%0A    //
  it('creates
@@ -716,36 +716,45 @@
 d', (done) =%3E %7B%0A
+    //
 %0A   
+ //
      const expec
@@ -763,32 +763,35 @@
 dActions = %7B%0A   
+ //
          type: a
@@ -813,24 +813,27 @@
 TH_FAIL,%0A   
+ //
          err
@@ -838,35 +838,47 @@
 rror: %7B%7D%0A   
+ //
      %7D%0A
+    //
 %0A   
+ //
      const s
@@ -893,32 +893,35 @@
 ockStore(%7B%7D)%0A   
+ //
      return stor
@@ -971,32 +971,34 @@
 s) =%3E %7B%0A    
+//
         
 expect(res).
@@ -977,32 +977,33 @@
 %7B%0A    //        
+ 
 expect(res).toEq
@@ -1018,32 +1018,35 @@
 ctedActions)%0A   
+ //
          done()%0A
@@ -1040,32 +1040,35 @@
       done()%0A   
+ //
      %7D)%0A    %7D)%0A%7D
@@ -1058,19 +1058,22 @@
 /     %7D)%0A   
+ //
  %7D)%0A%7D)%0A

comment LOGIN AUTH FAIL in auth/index.test