Skip to content

Commit

Permalink
remove unnecessary props/dependencies and rename argument
Browse files Browse the repository at this point in the history
  • Loading branch information
nerrad committed Jul 27, 2019
1 parent e0920c5 commit 1169f9d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/data/src/components/use-select/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,11 @@ describe( 'useSelect', () => {
} );
} );
describe( 'rerenders as expected with various mapSelect return types', () => {
const getComponent = ( mapSelectSpy, dependencyKey ) => ( props ) => {
const dependencies = props[ dependencyKey ];
mapSelectSpy.mockImplementation(
const getComponent = ( selectSpy ) => () => {
selectSpy.mockImplementation(
( select ) => select( 'testStore' ).testSelector()
);
const data = useSelect( mapSelectSpy, [ dependencies ] );
const data = useSelect( selectSpy, [] );
return <div data={ data } />;
};
let selectorSpy,
Expand All @@ -159,7 +158,7 @@ describe( 'useSelect', () => {
} );
registry.subscribe = subscriberSpy;
selectSpy = jest.fn();
TestComponent = getComponent( selectSpy, 'keyName' );
TestComponent = getComponent( selectSpy );
} );
[
[
Expand Down Expand Up @@ -199,7 +198,7 @@ describe( 'useSelect', () => {
act( () => {
renderer = TestRenderer.create(
<RegistryProvider value={ registry }>
<TestComponent keyName="foo" />
<TestComponent />
</RegistryProvider>
);
} );
Expand Down

0 comments on commit 1169f9d

Please sign in to comment.