Skip to content

Commit

Permalink
Prefer WithRegistrySetup to WithTestRegistry.
Browse files Browse the repository at this point in the history
  • Loading branch information
techanvil committed Jul 26, 2024
1 parent 7705f0c commit fcf4f37
Showing 1 changed file with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
/**
* Internal dependencies
*/
import {
createTestRegistry,
WithTestRegistry,
} from '../../../../../../tests/js/utils';
import WithRegistrySetup from '../../../../../../tests/js/WithRegistrySetup';
import { MODULES_READER_REVENUE_MANAGER } from '../../datastore/constants';
import SetupMain from './SetupMain';

Expand All @@ -42,16 +39,16 @@ export default {
component: SetupMain,
decorators: [
( Story ) => {
const registry = createTestRegistry();

registry
.dispatch( MODULES_READER_REVENUE_MANAGER )
.receiveGetPublications( [] );
function setupRegistry( registry ) {
registry
.dispatch( MODULES_READER_REVENUE_MANAGER )
.receiveGetPublications( [] );
}

return (
<WithTestRegistry registry={ registry }>
<WithRegistrySetup func={ setupRegistry }>
<Story />
</WithTestRegistry>
</WithRegistrySetup>
);
},
],
Expand Down

0 comments on commit fcf4f37

Please sign in to comment.