mirror of
https://github.com/m-lamonaca/dev-notes.git
synced 2025-04-13 22:36:38 +00:00
Improve variable names
This commit is contained in:
parent
a2aec9fc3f
commit
990709787c
1 changed files with 10 additions and 8 deletions
|
@ -70,14 +70,14 @@ import reducer from "path/to/reducer";
|
||||||
import * as actions from "path/to/actionCreators";
|
import * as actions from "path/to/actionCreators";
|
||||||
|
|
||||||
it("test description", () => {
|
it("test description", () => {
|
||||||
const initialState = /* satte before the action */;
|
const initialState = /* state before the action */;
|
||||||
const stateUpdate = /* modified state */;
|
const finalState = /* expected state after the action */
|
||||||
|
const data = /* data passed to the action creator */;
|
||||||
const action = actions.actionCreator(stateUpdate);
|
|
||||||
|
|
||||||
|
const action = actions.actionCreator(data);
|
||||||
const newState = reducer(initialState, action);
|
const newState = reducer(initialState, action);
|
||||||
|
|
||||||
expect(newState.property).toEqual(actual);
|
expect(newState).toEqual(finalState);
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -93,12 +93,14 @@ import * as actions from "path/to/actionCreators";
|
||||||
it("test description", () => {
|
it("test description", () => {
|
||||||
const store = createStore(toorReducer, initialState);
|
const store = createStore(toorReducer, initialState);
|
||||||
|
|
||||||
const stateUpdate = /* modified state */;
|
const expectedState = /* state after the update */
|
||||||
const action = actions.actionCreator(stateUpdate);
|
|
||||||
|
const data = /* action creator input */;
|
||||||
|
const action = actions.actionCreator(data);
|
||||||
store.dispatch(action);
|
store.dispatch(action);
|
||||||
|
|
||||||
const state = store.getState();
|
const state = store.getState();
|
||||||
expect(state).toEqual(stateUpdate);
|
expect(state).toEqual(expectedState);
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue