Skip to content

Commit

Permalink
Revert stories.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Gent committed May 12, 2021
1 parent 9197a28 commit 94be501
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 44 deletions.
2 changes: 1 addition & 1 deletion assets/js/modules/analytics/datastore/setup-flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const { createRegistrySelector } = Data;

const baseSelectors = {
getSetupFlowMode: createRegistrySelector( ( select ) => () => {
// The Google Analytics 4 datastore hasn't been loaded, so we have
// The Google Analytics 4 is not enabled, so we have
// to use the legacy implementation.
if ( ! isFeatureEnabled( 'ga4setup' ) ) {
return SETUP_FLOW_MODE_LEGACY;
Expand Down
45 changes: 2 additions & 43 deletions stories/module-analytics-setup.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,63 +21,22 @@
*/
import { storiesOf } from '@storybook/react';

/**
* WordPress dependencies
*/
import { createRegistry } from '@wordpress/data';

/**
* Internal dependencies
*/
import * as coreForms from '../assets/js/googlesitekit/datastore/forms';
import * as coreLocation from '../assets/js/googlesitekit/datastore/location';
import * as coreModules from '../assets/js/googlesitekit/modules';
import * as coreSite from '../assets/js/googlesitekit/datastore/site';
import * as coreUi from '../assets/js/googlesitekit/datastore/ui';
import * as coreUser from '../assets/js/googlesitekit/datastore/user';
import * as coreWidgets from '../assets/js/googlesitekit/widgets';
import * as modulesAdSense from '../assets/js/modules/adsense';
import * as modulesAnalytics from '../assets/js/modules/analytics';
import * as modulesIdeaHub from '../assets/js/modules/idea-hub';
import * as modulesOptimize from '../assets/js/modules/optimize';
import * as modulesPageSpeedInsights from '../assets/js/modules/pagespeed-insights';
import * as modulesSearchConsole from '../assets/js/modules/search-console';
import * as modulesTagManager from '../assets/js/modules/tagmanager';
import ModuleSetup from '../assets/js/components/setup/ModuleSetup';
import * as fixtures from '../assets/js/modules/analytics/datastore/__fixtures__';
import { STORE_NAME, ACCOUNT_CREATE, PROFILE_CREATE, PROVISIONING_SCOPE } from '../assets/js/modules/analytics/datastore/constants';
import { CORE_SITE } from '../assets/js/googlesitekit/datastore/site/constants';
import { CORE_USER } from '../assets/js/googlesitekit/datastore/user/constants';
import {
WithTestRegistry,
createTestRegistry,
provideModules,
provideModuleRegistrations,
} from '../tests/js/utils';
import { generateGTMAnalyticsPropertyStory } from './utils/generate-gtm-analytics-property-story';

const createLegacyTestRegistry = () => {
const registry = createRegistry();

[
coreForms,
coreLocation,
coreModules,
coreSite,
coreUser,
coreUi,
coreWidgets,
modulesAdSense,
modulesAnalytics,
modulesIdeaHub,
modulesOptimize,
modulesPageSpeedInsights,
modulesSearchConsole,
modulesTagManager,
].forEach( ( { registerStore } ) => registerStore?.( registry ) );

return registry;
};

function Setup( props ) {
return (
<WithTestRegistry { ...props }>
Expand All @@ -99,7 +58,7 @@ function usingGenerateGTMAnalyticsPropertyStory( args ) {

const withRegistry = ( Story ) => {
global._googlesitekitLegacyData.setup.moduleToSetup = 'analytics';
const registry = createLegacyTestRegistry();
const registry = createTestRegistry();
provideModules( registry, [ {
slug: 'analytics',
active: true,
Expand Down

0 comments on commit 94be501

Please sign in to comment.