Skip to content

Commit

Permalink
Changed the 'toParams' arg to 'params' in state-transitions-to.js and…
Browse files Browse the repository at this point in the history
… fixed test (#58)
  • Loading branch information
hally9k authored Jul 20, 2016
1 parent abd1ff7 commit e3ec14e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/__tests__/state-transition-to.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ describe('stateTransitionTo', () => {
it('should create an action containing the state to transition to', () => {
let action = stateTransitionTo('example', { test: 'hello' }, { option: 'world' });
expect(action.payload.to).to.equal('example');
expect(action.payload.toParams.test).to.equal('hello');
expect(action.payload.params.test).to.equal('hello');
expect(action.payload.options.option).to.equal('world');
expect(action.type).to.equal('@@reduxUiRouter/transitionTo');
});

it('should create an action when to params are undefined', () => {
let action = stateTransitionTo('example', undefined, undefined);
expect(action.payload.to).to.equal('example');
expect(action.payload.toParams).to.equal(undefined);
expect(action.payload.params).to.equal(undefined);
expect(action.payload.options).to.equal(undefined);
expect(action.type).to.equal('@@reduxUiRouter/transitionTo');
});
Expand Down
6 changes: 3 additions & 3 deletions src/state-transition-to.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import { STATE_TRANSITION_TO } from './action-types';
* http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$state
*
* @param {String} to - State name
* @param {Object} toParams - (optional) Parameters to send with state
* @param {Object} params - (optional) Parameters to send with state
* @param {Object} options - (optional) Options object
* @return {Object} Action object
*/
export default function stateTransitionTo(to, toParams, options) {
export default function stateTransitionTo(to, params, options) {
return {
type: STATE_TRANSITION_TO,
payload: {
to,
toParams,
params,
options,
},
};
Expand Down

0 comments on commit e3ec14e

Please sign in to comment.