Skip to content
This repository has been archived by the owner on Sep 12, 2020. It is now read-only.

Commit

Permalink
Fix failing test, the result looks much more correct now
Browse files Browse the repository at this point in the history
  • Loading branch information
bmealhouse committed Feb 17, 2019
1 parent 8a7ea8a commit ef7d6cf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/server.test.js
Expand Up @@ -8,7 +8,11 @@ import SyncGetInitialProps from './components/sync-get-initial-props'
import configureStore from './store/configure-store'
import createSnapshot from './utils/create-snapshot'
import getInitialProps from './utils/get-initial-props'
import {STATIC_PROP_TEXT, SYNC_REDUX_PROP_TEXT} from './constants'
import {
ASYNC_REDUX_SAGA_PROP_TEXT,
STATIC_PROP_TEXT,
SYNC_REDUX_PROP_TEXT,
} from './constants'

test('Wrapped component passes along React props', () => {
const WrappedComponent = withRedux(configureStore)(
Expand Down Expand Up @@ -49,7 +53,10 @@ test('Wrapped component awaits asynchronous getInitialProps', async () => {

const props = await getInitialProps(WrappedComponent)
expect(props.isServer).toBeTruthy()
expect(props.initialState).toEqual({syncReduxProp: SYNC_REDUX_PROP_TEXT})
expect(props.initialState).toEqual({
syncReduxProp: SYNC_REDUX_PROP_TEXT,
asyncReduxSagaProp: ASYNC_REDUX_SAGA_PROP_TEXT,
})
expect(props.initialProps).toEqual({staticProp: STATIC_PROP_TEXT})

createSnapshot(WrappedComponent, props)
Expand Down

0 comments on commit ef7d6cf

Please sign in to comment.