Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
test(configure): test with non-global this
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroenv committed Apr 8, 2019
1 parent e75bbb3 commit 9d404d3
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ describe('connectConfigure', () => {
const contextValue = { ais: { mainTargetedIndex: 'index' } };

it('propagates the props to the SearchParameters without children & contextValue', () => {
const searchParameters = connect.getSearchParameters(
const searchParameters = connect.getSearchParameters.call(
{},
new SearchParameters(),
{ distinct: 1, whatever: 'please', children: 'whatever', contextValue },
{}
Expand Down Expand Up @@ -44,7 +45,9 @@ describe('connectConfigure', () => {
});

it('calling transitionState should add configure parameters to the search state', () => {
let searchState = connect.transitionState(
const ctx = {};
let searchState = connect.transitionState.call(
ctx,
{
distinct: 1,
whatever: 'please',
Expand All @@ -58,7 +61,8 @@ describe('connectConfigure', () => {
configure: { distinct: 1, whatever: 'please' },
});

searchState = connect.transitionState(
searchState = connect.transitionState.call(
ctx,
{ whatever: 'other', children: 'whatever', contextValue },
{ configure: { distinct: 1, whatever: 'please' } },
{ configure: { distinct: 1, whatever: 'please' } }
Expand All @@ -68,7 +72,8 @@ describe('connectConfigure', () => {
});

it('calling cleanUp should remove configure parameters from the search state', () => {
let searchState = connect.cleanUp(
let searchState = connect.cleanUp.call(
{},
{
distinct: 1,
whatever: 'please',
Expand All @@ -85,7 +90,8 @@ describe('connectConfigure', () => {
);
expect(searchState).toEqual({ configure: { another: 'parameters' } });

searchState = connect.cleanUp(
searchState = connect.cleanUp.call(
{},
{ distinct: 1, whatever: 'please', children: 'whatever', contextValue },
{ configure: { distinct: 1, whatever: 'please' } }
);
Expand Down

0 comments on commit 9d404d3

Please sign in to comment.