Skip to content

Commit 539ce85

Browse files
aduthjsnajdr
andauthored
Remove unused feature flags (#103646)
* Remove unused feature flag "migration-flow/experiment" * Remove unused feature flag "jetpack/simplify-pricing-structure" * Remove unused "onboarding/trail-map-feature-grid" features * Remove unused "plans/pro-plan" feature * Remove unused "plans/starter-plan" feature * Remove unused "signup/professional-email-step" feature * Remove unused "p2-enabled" feature * Remove unused "difm/allow-extra-pages" feature * Use jest.mocked to type-cast function for mocking See: #103646 (comment) Co-Authored-By: Jarda Snajdr <664258+jsnajdr@users.noreply.github.com> --------- Co-authored-by: Jarda Snajdr <664258+jsnajdr@users.noreply.github.com>
1 parent 25e18aa commit 539ce85

File tree

12 files changed

+1
-82
lines changed

12 files changed

+1
-82
lines changed

client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-how-to-migrate/diy-option/test/index.tsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
11
/**
22
* @jest-environment jsdom
33
*/
4-
import config, { isEnabled } from '@automattic/calypso-config';
54
import { render, screen } from '@testing-library/react';
65
import { DIYOption } from '..';
76

8-
const isMigrationExperimentEnabled = isEnabled( 'migration-flow/experiment' );
97
const onClick = jest.fn();
108

11-
const restoreIsMigrationExperimentEnabled = () => {
12-
if ( isMigrationExperimentEnabled ) {
13-
config.enable( 'migration-flow/experiment' );
14-
} else {
15-
config.disable( 'migration-flow/experiment' );
16-
}
17-
};
18-
199
describe( 'DIYOption', () => {
20-
afterEach( () => {
21-
restoreIsMigrationExperimentEnabled();
22-
} );
23-
2410
it( 'should render the DIY link', () => {
25-
config.enable( 'migration-flow/experiment' );
26-
2711
render( <DIYOption onClick={ onClick } /> );
2812

2913
expect( screen.queryByText( /I'll do it myself/ ) ).toBeInTheDocument();

client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-identify/test/index.tsx

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/**
22
* @jest-environment jsdom
33
*/
4-
// @ts-nocheck - TODO: Fix TypeScript issues
5-
import config, { isEnabled } from '@automattic/calypso-config';
64
import { screen, waitFor } from '@testing-library/react';
75
import userEvent from '@testing-library/user-event';
86
import nock from 'nock';
@@ -57,27 +55,14 @@ const API_RESPONSE_WITH_OTHER_PLATFORM: UrlData = {
5755
const MOCK_WORDPRESS_SITE_SLUG = 'test-example.wordpress.com';
5856
const getInput = () => screen.getByLabelText( /Enter your site address/ );
5957

60-
const isMigrationExperimentEnabled = isEnabled( 'migration-flow/experiment' );
61-
62-
const restoreIsMigrationExperimentEnabled = () => {
63-
if ( isMigrationExperimentEnabled ) {
64-
config.enable( 'migration-flow/experiment' );
65-
} else {
66-
config.disable( 'migration-flow/experiment' );
67-
}
68-
};
69-
7058
describe( 'SiteMigrationIdentify', () => {
7159
beforeAll( () => nock.disableNetConnect() );
7260
beforeEach( () => {
7361
jest.clearAllMocks();
7462
} );
75-
afterEach( () => {
76-
restoreIsMigrationExperimentEnabled();
77-
} );
7863

7964
it( 'continues the flow when the platform is wordpress', async () => {
80-
useSiteSlug.mockReturnValue( MOCK_WORDPRESS_SITE_SLUG );
65+
jest.mocked( useSiteSlug ).mockReturnValue( MOCK_WORDPRESS_SITE_SLUG );
8166

8267
const submit = jest.fn();
8368
render( { navigation: { submit } } );
@@ -177,8 +162,6 @@ describe( 'SiteMigrationIdentify', () => {
177162
} );
178163

179164
it( 'shows why host with us points', async () => {
180-
config.disable( 'migration-flow/experiment' );
181-
182165
const submit = jest.fn();
183166
render( { navigation: { submit } } );
184167

config/development.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
"jetpack/pricing-add-boost-social": true,
9494
"jetpack/pricing-page-annual-only": true,
9595
"jetpack/sharing-buttons-block-enabled": true,
96-
"jetpack/simplify-pricing-structure": false,
9796
"jetpack/standalone-plugin-onboarding-update-v1": true,
9897
"jetpack/zendesk-chat-for-logged-in-users": true,
9998
"jetpack/crm-downloads": true,
@@ -119,7 +118,6 @@
119118
"marketplace-test": true,
120119
"me/account-close": true,
121120
"me/account/color-scheme-picker": true,
122-
"migration-flow/experiment": false,
123121
"migration-flow/introductory-offer": true,
124122
"migration-flow/cancel-difm": true,
125123
"oauth": false,
@@ -133,18 +131,13 @@
133131
"onboarding/interval-dropdown": true,
134132
"onboarding/step-container-v2-migration-flow": true,
135133
"onboarding/step-container-v2-import-flow": true,
136-
"onboarding/trail-map-feature-grid": false,
137-
"onboarding/trail-map-feature-grid-copy": false,
138-
"onboarding/trail-map-feature-grid-structure": false,
139134
"onboarding/user-on-stepper-hosting": true,
140135
"p2/p2-plus": true,
141136
"page/export": true,
142137
"plans/hosting-trial": true,
143138
"plans/migration-trial": true,
144139
"plans/personal-plan": true,
145-
"plans/pro-plan": false,
146140
"plans/self-service-downgrade": false,
147-
"plans/starter-plan": false,
148141
"plans/updated-storage-labels": true,
149142
"plans/upgradeable-storage": true,
150143
"post-editor/checkout-overlay": true,
@@ -171,7 +164,6 @@
171164
"settings/security/monitor": true,
172165
"sign-in-with-apple": true,
173166
"sign-in-with-apple/redirect": true,
174-
"signup/professional-email-step": false,
175167
"signup/social": true,
176168
"signup/social-first": true,
177169
"site-indicator": true,

config/horizon.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"jetpack/pricing-add-boost-social": true,
5656
"jetpack/pricing-page-annual-only": true,
5757
"jetpack/sharing-buttons-block-enabled": false,
58-
"jetpack/simplify-pricing-structure": false,
5958
"jetpack/standalone-plugin-onboarding-update-v1": true,
6059
"jetpack/crm-downloads": true,
6160
"jitms": true,
@@ -76,19 +75,15 @@
7675
"marketplace-reviews-notification": false,
7776
"marketplace-test": false,
7877
"me/account/color-scheme-picker": true,
79-
"migration-flow/experiment": false,
8078
"migration-flow/introductory-offer": true,
8179
"migration-flow/cancel-difm": true,
8280
"onboarding/create-course": false,
8381
"onboarding/step-container-v2-import-flow": true,
8482
"onboarding/step-container-v2-migration-flow": true,
85-
"p2-enabled": false,
8683
"p2/p2-plus": true,
8784
"plans/hosting-trial": true,
8885
"plans/migration-trial": true,
8986
"plans/personal-plan": true,
90-
"plans/pro-plan": false,
91-
"plans/starter-plan": false,
9287
"plans/updated-storage-labels": true,
9388
"plans/upgradeable-storage": true,
9489
"post-editor/checkout-overlay": true,
@@ -109,7 +104,6 @@
109104
"settings/newsletter-settings-page": true,
110105
"settings/security/monitor": true,
111106
"sign-in-with-apple": true,
112-
"signup/professional-email-step": false,
113107
"signup/social": true,
114108
"signup/social-first": true,
115109
"site-indicator": true,

config/jetpack-cloud-development.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
"jetpack/manage-sites-v2-menu": false,
6262
"jetpack/search-product": true,
6363
"jetpack/server-credentials-advanced-flow": true,
64-
"jetpack/simplify-pricing-structure": false,
6564
"jetpack/standalone-plugin-onboarding-update-v1": true,
6665
"jetpack/url-only-connection": true,
6766
"jetpack/streamline-license-purchases": false,

config/jetpack-cloud-horizon.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"jetpack/manage-sites-v2-menu": false,
5656
"jetpack/search-product": true,
5757
"jetpack/server-credentials-advanced-flow": true,
58-
"jetpack/simplify-pricing-structure": false,
5958
"jetpack/standalone-plugin-onboarding-update-v1": true,
6059
"jetpack/streamline-license-purchases": false,
6160
"layout/app-banner": false,

config/jetpack-cloud-production.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
"jetpack/manage-simple-sites": true,
5959
"jetpack/manage-sites-v2-menu": false,
6060
"jetpack/server-credentials-advanced-flow": true,
61-
"jetpack/simplify-pricing-structure": false,
6261
"jetpack/standalone-plugin-onboarding-update-v1": true,
6362
"jetpack/streamline-license-purchases": false,
6463
"jetpack/crm-downloads": true,

config/jetpack-cloud-stage.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
"jetpack/pro-dashboard-wpcom-atomic-hosting": true,
5959
"jetpack/manage-simple-sites": true,
6060
"jetpack/server-credentials-advanced-flow": true,
61-
"jetpack/simplify-pricing-structure": false,
6261
"jetpack/standalone-plugin-onboarding-update-v1": true,
6362
"jetpack/url-only-connection": true,
6463
"jetpack/streamline-license-purchases": false,

config/production.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
"jetpack/pricing-add-boost-social": true,
7171
"jetpack/pricing-page-annual-only": true,
7272
"jetpack/sharing-buttons-block-enabled": false,
73-
"jetpack/simplify-pricing-structure": false,
7473
"jetpack/standalone-plugin-onboarding-update-v1": true,
7574
"jetpack/zendesk-chat-for-logged-in-users": true,
7675
"jetpack/crm-downloads": true,
@@ -93,7 +92,6 @@
9392
"marketplace-test": false,
9493
"me/account-close": true,
9594
"me/account/color-scheme-picker": true,
96-
"migration-flow/experiment": false,
9795
"migration-flow/introductory-offer": true,
9896
"migration-flow/cancel-difm": false,
9997
"onboarding/create-course": false,
@@ -106,17 +104,12 @@
106104
"onboarding/interval-dropdown": true,
107105
"onboarding/step-container-v2-import-flow": true,
108106
"onboarding/step-container-v2-migration-flow": true,
109-
"onboarding/trail-map-feature-grid": false,
110-
"onboarding/trail-map-feature-grid-copy": false,
111-
"onboarding/trail-map-feature-grid-structure": false,
112107
"onboarding/user-on-stepper-hosting": false,
113108
"p2/p2-plus": true,
114109
"plans/hosting-trial": true,
115110
"plans/migration-trial": true,
116111
"plans/personal-plan": true,
117-
"plans/pro-plan": false,
118112
"plans/self-service-downgrade": false,
119-
"plans/starter-plan": false,
120113
"plans/updated-storage-labels": true,
121114
"plans/upgradeable-storage": true,
122115
"post-editor/checkout-overlay": true,
@@ -141,7 +134,6 @@
141134
"settings/security/monitor": true,
142135
"sign-in-with-apple": true,
143136
"sign-in-with-apple/redirect": true,
144-
"signup/professional-email-step": false,
145137
"signup/social": true,
146138
"signup/social-first": true,
147139
"site-indicator": true,

config/stage.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
"jetpack/pricing-add-boost-social": true,
6868
"jetpack/pricing-page-annual-only": true,
6969
"jetpack/sharing-buttons-block-enabled": false,
70-
"jetpack/simplify-pricing-structure": false,
7170
"jetpack/standalone-plugin-onboarding-update-v1": true,
7271
"jetpack/zendesk-chat-for-logged-in-users": true,
7372
"jetpack/crm-downloads": true,
@@ -91,7 +90,6 @@
9190
"marketplace-test": true,
9291
"me/account-close": true,
9392
"me/account/color-scheme-picker": true,
94-
"migration-flow/experiment": false,
9593
"migration-flow/introductory-offer": true,
9694
"migration-flow/cancel-difm": false,
9795
"onboarding/create-course": false,
@@ -104,17 +102,12 @@
104102
"onboarding/interval-dropdown": true,
105103
"onboarding/step-container-v2-import-flow": true,
106104
"onboarding/step-container-v2-migration-flow": true,
107-
"onboarding/trail-map-feature-grid": false,
108-
"onboarding/trail-map-feature-grid-copy": false,
109-
"onboarding/trail-map-feature-grid-structure": false,
110105
"p2/p2-plus": true,
111106
"page/export": true,
112107
"plans/hosting-trial": true,
113108
"plans/migration-trial": true,
114109
"plans/personal-plan": true,
115-
"plans/pro-plan": false,
116110
"plans/self-service-downgrade": false,
117-
"plans/starter-plan": false,
118111
"plans/updated-storage-labels": true,
119112
"plans/upgradeable-storage": true,
120113
"post-editor/checkout-overlay": true,
@@ -139,7 +132,6 @@
139132
"settings/security/monitor": true,
140133
"sign-in-with-apple": true,
141134
"sign-in-with-apple/redirect": true,
142-
"signup/professional-email-step": false,
143135
"signup/social": true,
144136
"signup/social-first": true,
145137
"site-indicator": true,

config/test.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"current-site/notice": true,
4040
"devdocs": true,
4141
"devdocs/redirect-loggedout-homepage": true,
42-
"difm/allow-extra-pages": false,
4342
"global-styles/on-personal-plan": false,
4443
"google-my-business": false,
4544
"help": true,
@@ -57,7 +56,6 @@
5756
"jetpack/features-section/simple": true,
5857
"jetpack/pricing-page-annual-only": true,
5958
"jetpack/sharing-buttons-block-enabled": false,
60-
"jetpack/simplify-pricing-structure": false,
6159
"jitms": true,
6260
"lasagna": false,
6361
"launchpad-updates": false,
@@ -73,7 +71,6 @@
7371
"marketplace-fetch-all-dynamic-products": true,
7472
"marketplace-personal-premium": false,
7573
"me/account-close": true,
76-
"migration-flow/experiment": false,
7774
"migration-flow/introductory-offer": true,
7875
"migration-flow/cancel-difm": false,
7976
"onboarding/create-course": false,
@@ -85,13 +82,10 @@
8582
"onboarding/import-from-wordpress": true,
8683
"onboarding/step-container-v2-import-flow": true,
8784
"onboarding/step-container-v2-migration-flow": true,
88-
"p2-enabled": false,
8985
"plans/hosting-trial": true,
9086
"plans/migration-trial": true,
9187
"plans/personal-plan": true,
92-
"plans/pro-plan": false,
9388
"plans/self-service-downgrade": false,
94-
"plans/starter-plan": false,
9589
"post-list/qr-code-link": false,
9690
"press-this": true,
9791
"publicize-preview": true,

config/wpcalypso.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"jetpack/pricing-add-boost-social": true,
7373
"jetpack/pricing-page-annual-only": true,
7474
"jetpack/sharing-buttons-block-enabled": false,
75-
"jetpack/simplify-pricing-structure": false,
7675
"jetpack-social/advanced-plan": false,
7776
"jetpack/zendesk-chat-for-logged-in-users": true,
7877
"jitms": true,
@@ -96,7 +95,6 @@
9695
"marketplace-test": true,
9796
"me/account-close": true,
9897
"me/account/color-scheme-picker": true,
99-
"migration-flow/experiment": false,
10098
"migration-flow/introductory-offer": true,
10199
"migration-flow/cancel-difm": false,
102100
"onboarding/create-course": false,
@@ -109,17 +107,12 @@
109107
"onboarding/interval-dropdown": true,
110108
"onboarding/step-container-v2-import-flow": true,
111109
"onboarding/step-container-v2-migration-flow": true,
112-
"onboarding/trail-map-feature-grid-copy": false,
113-
"onboarding/trail-map-feature-grid-structure": false,
114-
"onboarding/trail-map-feature-grid": false,
115110
"onboarding/user-on-stepper-hosting": true,
116111
"p2/p2-plus": true,
117112
"plans/hosting-trial": true,
118113
"plans/migration-trial": true,
119114
"plans/personal-plan": true,
120-
"plans/pro-plan": false,
121115
"plans/self-service-downgrade": false,
122-
"plans/starter-plan": false,
123116
"plans/updated-storage-labels": true,
124117
"plans/upgradeable-storage": true,
125118
"post-editor/checkout-overlay": true,
@@ -143,7 +136,6 @@
143136
"settings/security/monitor": true,
144137
"sign-in-with-apple": true,
145138
"sign-in-with-apple/redirect": true,
146-
"signup/professional-email-step": false,
147139
"signup/social": true,
148140
"signup/social-first": true,
149141
"site-indicator": true,

0 commit comments

Comments
 (0)