import {getForecastHourly} from './forecastHourlyActions'
import thunk from 'redux-thunk'
import configureMockStore from 'redux-mock-store'
import fetchMock from 'fetch-mock'
import * as api from '../../app/api'

const middlewares = [ thunk ]
const mockStore = configureMockStore(middlewares)

describe('forecastHourlyActions', () => {
  it('should dispatch action GET_FORECAST_HOURLY and check for its fulfillment', () => {
    const location = 5128581
    const store = mockStore({ })

    fetchMock.get(api.forecast(location), {data: 'mockData'})
    const action = getForecastHourly(location)

    const expectedActions = [
         {type: 'GET_FORECAST_HOURLY', payload: new Promise(() => {}, () => {})}
    ]
    return store.dispatch(action).payload
         .then(data => { // return of async actions
           expect(store.getActions()).toEqual(expectedActions)
           expect(data).toEqual({data: 'mockData'})
         })
  })
})

@@ -18,16 +18,51 @@
 stHourly
+, setForecastHourlyActiveReportType
 %7D from '
@@ -239,16 +239,69 @@
 app/api'
+%0Aimport * as types from './forecastHourlyActionTypes'
 %0A%0Aconst 
@@ -1021,12 +1021,424 @@
  %7D)%0A  %7D)
+%0A%0A  it('should return an action of type SET_FORECAST_HOURLY_ACTIVE_REPORT_TYPE', () =%3E %7B%0A    const action = setForecastHourlyActiveReportType('details')%0A    const store = mockStore(%7B %7D)%0A    const expectedActions = %5B%0A      %7B%0A        type: types.SET_FORECAST_HOURLY_ACTIVE_REPORT_TYPE,%0A        payload: 'details'%0A      %7D%0A    %5D%0A    store.dispatch(action)%0A    expect(store.getActions()).toEqual(expectedActions)%0A  %7D)
 %0A%7D)%0A

Add test case for action setForecastHourlyActiveReportType