2017-08-14 18 views
0

當我試圖用戶存儲在我的測試提供了關鍵的「儀表板」沒有減速

import React from 'react'; 
import { createStore } from 'redux'; 
import { Provider } from 'react-redux'; 
import { mount } from 'enzyme'; 
import chai from 'chai'; 
import App from '../layouts/App'; 
import store from '../redux/configureStore'; 
const expect = chai.expect; 
// let store; 
let app; 
describe('login',() => { 
    beforeEach(() => { 
    app = mount (
     <Provider store={store}> 
      <App /> 
     </Provider> 
    ) 
    }) 

,但我有沒有提供減速機的關鍵「儀表板」 這裏是我的configStore主代碼

const reducer = { 
    dashboard, 
    PageLogin, 
}; 
const store = createStore(
    reducer, 
    composeEnhancers(applyMiddleware(sagaMiddleware)) 
); 

我PageLogin,但不能得到儀表盤 且有儀表盤主代碼

export { 
    snackbarActions, 
    dialogActions, 
    userConfigActions, 
    authActions, 
    progressActions, 
    UserProfileActions, 
    // ... 
}; 

回答

1

您需要使用combineReducers來組合您的減速器

import { combineReducers } from 'redux' 

const reducer = combineReducers({ 
    dashboard, 
    PageLogin, 
}) 
相關問題