diff --git a/projects/plugins/boost/app/assets/src/js/features/critical-css/critical-css-module/critical-css-module.module.scss b/projects/plugins/boost/app/assets/src/js/features/critical-css/critical-css-module/critical-css-module.module.scss deleted file mode 100644 index 5e7dfe919dc8..000000000000 --- a/projects/plugins/boost/app/assets/src/js/features/critical-css/critical-css-module/critical-css-module.module.scss +++ /dev/null @@ -1,30 +0,0 @@ -.tooltip-wrapper { - margin: 1em 0; - - p { - display: inline; - } - - :global(.icon-tooltip-content) { - - p { - display: block; - } - } -} - -@media (max-width: 768px) { - - .tooltip-wrapper :global(.icon-tooltip-wrapper) { - display: block; - margin-left: 50%; - left: -12px; - - // Only an inline popover is a descendant here, so this is the legacy width. - // `.components-popover` pads specificity so this outranks - // premium-tooltip's 440px rule. - :global(.icon-tooltip-container.components-popover .components-popover__content) { - width: 70vw; - } - } -} diff --git a/projects/plugins/boost/app/assets/src/js/features/critical-css/critical-css-module/critical-css-module.test.tsx b/projects/plugins/boost/app/assets/src/js/features/critical-css/critical-css-module/critical-css-module.test.tsx index c7932e1518ac..4102e250d83a 100644 --- a/projects/plugins/boost/app/assets/src/js/features/critical-css/critical-css-module/critical-css-module.test.tsx +++ b/projects/plugins/boost/app/assets/src/js/features/critical-css/critical-css-module/critical-css-module.test.tsx @@ -8,10 +8,6 @@ import type { ReactNode } from 'react'; const mockRegenerate = jest.fn(); jest.mock( '@wordpress/api-fetch', () => jest.fn( () => new Promise( () => {} ) ) ); -jest.mock( - '@automattic/jetpack-my-jetpack/components/product-interstitial/assets/boost.webp', - () => '' -); jest.mock( '$features/module/module', () => ( { __esModule: true, default: ( { @@ -35,7 +31,6 @@ jest.mock( '$features/critical-css/lib/stores/critical-css-state', () => ( { useRegenerateCriticalCssAction: () => ( { mutate: mockRegenerate } ), } ) ); jest.mock( '$lib/utils/analytics', () => ( { recordBoostEvent: jest.fn() } ) ); -jest.mock( '$lib/stores/pricing', () => ( { usePricing: () => null } ) ); jest.mock( '$lib/stores/premium-features', () => ( { usePremiumFeatures: () => [] } ) ); jest.mock( 'jetpackConfig', () => ( { consumer_slug: 'jetpack-boost' } ), { virtual: true } ); diff --git a/projects/plugins/boost/app/assets/src/js/features/image-cdn/image-cdn.test.tsx b/projects/plugins/boost/app/assets/src/js/features/image-cdn/image-cdn.test.tsx index 1bcd559dadde..ec5eea2278bf 100644 --- a/projects/plugins/boost/app/assets/src/js/features/image-cdn/image-cdn.test.tsx +++ b/projects/plugins/boost/app/assets/src/js/features/image-cdn/image-cdn.test.tsx @@ -5,10 +5,6 @@ import { useSingleModuleState } from '$features/module/lib/stores'; import ImageCdn from './image-cdn'; import type { ReactNode } from 'react'; -jest.mock( - '@automattic/jetpack-my-jetpack/components/product-interstitial/assets/boost.webp', - () => '' -); jest.mock( '$features/module/module', () => ( { __esModule: true, default: ( { children }: { children: ReactNode } ) =>
{ children }
, diff --git a/projects/plugins/boost/app/assets/src/js/features/premium-tooltip/premium-tooltip.module.scss b/projects/plugins/boost/app/assets/src/js/features/premium-tooltip/premium-tooltip.module.scss deleted file mode 100644 index 29a06f1deba7..000000000000 --- a/projects/plugins/boost/app/assets/src/js/features/premium-tooltip/premium-tooltip.module.scss +++ /dev/null @@ -1,63 +0,0 @@ -.tooltip { - margin-left: 6px; - line-height: 24px; -} - -// `wide` only reaches an inline popover, so restate its width here. -// Do not raise this rule's specificity: critical-css-module's mobile -// width is padded to outrank it. -.popover:global(.components-popover.icon-tooltip-container) :global(.components-popover__content) { - width: 440px; -} - -.popover :global(.icon-tooltip-title) { - margin-bottom: 20px; - color: #23282d; - font-weight: 600; - font-size: 20px; - line-height: 1.3; -} - -.popover :global(.icon-tooltip-content) { - font-size: 16px; - color: #2c3338; -} - -.popover :global(.icon-tooltip-content ul).list { - margin: 30px 0 30px 30px; - list-style-type: disc; -} - -.tooltip svg { - position: absolute; - left: 0; - bottom: 0; - fill: #8c8f94; -} - -// The button has no box, since the icon is out of flow, so ring the icon. -// Same states as WordPress's own button ring: any focus, but not while pressed. -.tooltip > :global(.components-button.is-link):focus:not(:active) { - outline: none; - - svg { - outline: var(--wp-admin-border-width-focus, 2px) solid var(--wp-admin-theme-color, #3858e9); - border-radius: 2px; - } -} - -.upgrade-cta { - - p { - display: block; - } - - :global(button) { - margin-top: 0; - margin-bottom: 0; - } - - :global(svg) { - position: relative; - } -} diff --git a/projects/plugins/boost/app/assets/src/js/features/premium-tooltip/premium-tooltip.tsx b/projects/plugins/boost/app/assets/src/js/features/premium-tooltip/premium-tooltip.tsx deleted file mode 100644 index 30ad4845cd54..000000000000 --- a/projects/plugins/boost/app/assets/src/js/features/premium-tooltip/premium-tooltip.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import { IconTooltip } from '@automattic/jetpack-components'; -import { __ } from '@wordpress/i18n'; -import styles from './premium-tooltip.module.scss'; -import { tooltipLayer } from '$features/module/tooltip-layer'; -import InterstitialModalCTA from '$features/upgrade-cta/interstitial-modal-cta'; - -const PremiumTooltip = () => { - return ( - - { __( - 'Actions that could change your CSS or HTML structure include, but are not limited to:', - 'jetpack-boost' - ) } - - -
- -
-
- ); -}; - -export default PremiumTooltip; diff --git a/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/interstitial-modal-cta.test.tsx b/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/interstitial-modal-cta.test.tsx deleted file mode 100644 index c7cf3f5f10d7..000000000000 --- a/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/interstitial-modal-cta.test.tsx +++ /dev/null @@ -1,93 +0,0 @@ -/* eslint-disable jest-dom/prefer-in-document */ -import apiFetch from '@wordpress/api-fetch'; -import { fireEvent, render, screen, waitFor, within } from '@testing-library/react'; -import { MODERN_ROOT_ID } from '$lib/modern/mode'; -import { usePremiumFeatures } from '$lib/stores/premium-features'; -import InterstitialModalCTA from './interstitial-modal-cta'; - -jest.mock( '@wordpress/api-fetch', () => jest.fn( () => new Promise( () => {} ) ) ); -jest.mock( - '@automattic/jetpack-my-jetpack/components/product-interstitial/assets/boost.webp', - () => '' -); -jest.mock( '$lib/stores/pricing', () => ( { usePricing: () => null } ) ); -jest.mock( '$lib/stores/premium-features', () => ( { - usePremiumFeatures: jest.fn( () => [] ), -} ) ); -jest.mock( 'jetpackConfig', () => ( { consumer_slug: 'jetpack-boost' } ), { virtual: true } ); - -const boostGlobal = { site: { online: true, myJetpack: true, host: 'unknown' } }; - -describe( 'InterstitialModalCTA', () => { - beforeEach( () => { - jest.mocked( apiFetch ).mockClear(); - jest.mocked( apiFetch ).mockImplementation( () => new Promise( () => {} ) ); - Object.assign( boostGlobal.site, { - online: true, - myJetpack: true, - host: 'unknown', - } ); - jest.mocked( usePremiumFeatures ).mockReturnValue( [] ); - Object.assign( globalThis, { - Jetpack_Boost: boostGlobal, - myJetpackInitialState: { products: { items: { boost: { slug: 'boost', title: 'Boost' } } } }, - JP_CONNECTION_INITIAL_STATE: {}, - } ); - } ); - - it( 'requests My Jetpack products and opens the upgrade prompt on a public site', async () => { - jest.mocked( apiFetch ).mockResolvedValue( { - boost: { - slug: 'boost', - title: 'Boost', - pricing_for_ui: { - tiers: { - upgraded: { - full_price: 120, - discount_price: 120, - currency_code: 'USD', - product_term: 'year', - }, - }, - }, - }, - } ); - boostGlobal.site.online = true; - render( ); - - expect( screen.getByRole( 'button', { name: /Upgrade now/ } ) ).toBeTruthy(); - expect( apiFetch ).toHaveBeenCalledWith( - expect.objectContaining( { path: 'my-jetpack/v1/site/products' } ) - ); - // eslint-disable-next-line testing-library/prefer-user-event -- This project does not provide user-event. - fireEvent.click( screen.getByRole( 'button', { name: /Upgrade now/ } ) ); - const modal = await screen.findByRole( 'dialog' ); - await waitFor( () => { - // eslint-disable-next-line jest-dom/prefer-to-have-attribute -- This Jest project does not load jest-dom. - expect( - within( modal ).getByRole( 'button', { name: 'Upgrade now' } ).hasAttribute( 'disabled' ) - ).toBe( false ); - } ); - expect( within( modal ).getByText( 'Automated critical CSS generation' ) ).toBeTruthy(); - } ); - - it( 'makes no My Jetpack request on an offline site', () => { - boostGlobal.site.online = false; - render( ); - - expect( screen.queryByRole( 'button' ) ).toBeNull(); - expect( apiFetch ).not.toHaveBeenCalled(); - } ); - - it( 'hides prompts when My Jetpack is unavailable', () => { - boostGlobal.site.myJetpack = false; - render(
); - render( , { - container: screen.getByTestId( 'dashboard-root' ), - } ); - expect( screen.queryByRole( 'button' ) ).toBeNull(); - expect( screen.queryByRole( 'link' ) ).toBeNull(); - expect( screen.queryByRole( 'dialog' ) ).toBeNull(); - expect( apiFetch ).not.toHaveBeenCalled(); - } ); -} ); diff --git a/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/interstitial-modal-cta.tsx b/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/interstitial-modal-cta.tsx deleted file mode 100644 index c37255269a06..000000000000 --- a/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/interstitial-modal-cta.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import getRedirectUrl from '@automattic/jetpack-components/tools/jp-redirect'; -import { ProductInterstitialMyJetpack } from '@automattic/jetpack-my-jetpack/components/product-interstitial-modal/index'; -import boostImage from '@automattic/jetpack-my-jetpack/components/product-interstitial/assets/boost.webp'; -import { __ } from '@wordpress/i18n'; -import UpgradeCTA from '$features/upgrade-cta/upgrade-cta'; -import { canOfferUpgrade } from '../../../../../../_inc/overview/lib/use-modules-state'; -import type { ReactNode } from 'react'; - -type InterstitialModalCTAProps = { - description?: string; - identifier: string; - customModalTrigger?: ReactNode; -}; - -const InterstitialModalCTA = ( { - description = '', - identifier, - customModalTrigger, -}: InterstitialModalCTAProps ) => { - // Mounting the modal fetches products from My Jetpack. - if ( ! canOfferUpgrade() ) { - return null; - } - - const learnMoreUrl = getRedirectUrl( 'jetpack-boost-interstitial-modal-learn-more' ); - - return ( - - } - buttonLabel={ __( 'Upgrade now', 'jetpack-boost' ) } - isWithVideo={ false } - secondaryColumn={ -
- Boost -
- } - secondaryButtonHref={ learnMoreUrl } - description={ __( - 'Unlock the full potential of Jetpack Boost with automated performance improvements and advanced image optimization for a consistently fast site.', - 'jetpack-boost' - ) } - features={ [ - __( 'Automated critical CSS generation', 'jetpack-boost' ), - __( 'Image CDN and quality controls', 'jetpack-boost' ), - __( 'Image guide and performance history', 'jetpack-boost' ), - __( 'Priority support', 'jetpack-boost' ), - ] } - /> - ); -}; - -export default InterstitialModalCTA; diff --git a/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/upgrade-cta.module.scss b/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/upgrade-cta.module.scss deleted file mode 100644 index 18d10f4c151c..000000000000 --- a/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/upgrade-cta.module.scss +++ /dev/null @@ -1,27 +0,0 @@ -@use "$css/main/variables"; - -.upgrade-cta { - width: 100%; - display: flex; - justify-content: space-between; - align-items: center; - padding: 16px 24px; - margin: 32px 0; - border: 2px solid var(--wp-admin-theme-color); - border-radius: variables.$border-radius; - background-color: #fff; - text-align: left; - cursor: pointer; - - .body p { - margin: 0; - } - - .action-line { - font-weight: 700; - } - - .icon svg { - color: var(--wp-admin-theme-color); - } -} diff --git a/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/upgrade-cta.test.tsx b/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/upgrade-cta.test.tsx deleted file mode 100644 index 14a22e916747..000000000000 --- a/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/upgrade-cta.test.tsx +++ /dev/null @@ -1,56 +0,0 @@ -/* eslint-disable jest-dom/prefer-in-document -- This Jest project does not load jest-dom. */ -import { fireEvent, render, screen } from '@testing-library/react'; -import { cloneElement as mockCloneElement } from 'react'; -import { recordBoostEvent } from '$lib/utils/analytics'; -import InterstitialModalCTA from './interstitial-modal-cta'; - -const mockOpenModal = jest.fn(); -jest.mock( '@automattic/jetpack-my-jetpack/components/product-interstitial-modal/index', () => ( { - ProductInterstitialMyJetpack: ( { slug, customModalTrigger } ) => - mockCloneElement( customModalTrigger, { onClick: () => mockOpenModal( slug ) } ), -} ) ); -jest.mock( - '@automattic/jetpack-my-jetpack/components/product-interstitial/assets/boost.webp', - () => '' -); -jest.mock( '$lib/utils/analytics', () => ( { recordBoostEvent: jest.fn() } ) ); -jest.mock( '$lib/stores/pricing', () => ( { - usePricing: () => ( { priceAfter: 120, currencyCode: 'USD' } ), -} ) ); - -beforeEach( () => { - jest.clearAllMocks(); - Object.assign( globalThis, { - Jetpack_Boost: { site: { online: true, myJetpack: true, host: 'unknown' } }, - } ); -} ); - -test.each( [ 'critical-css', 'image-cdn', 'cornerstone-10-pages' ] )( - '%s legacy notice opens the Boost interstitial with unchanged tracking', - identifier => { - render( ); - // eslint-disable-next-line testing-library/prefer-user-event -- This project does not provide user-event. - fireEvent.click( - screen.getByRole( 'button', { name: /Upgrade now only \$10\.00 per month/ } ) - ); - expect( mockOpenModal ).toHaveBeenCalledWith( 'boost' ); - expect( recordBoostEvent ).toHaveBeenCalledWith( 'upsell_cta_from_settings_page_in_plugin', { - identifier, - } ); - } -); - -test( 'keeps the legacy monthly price', () => { - render( ); - expect( - screen.getByRole( 'button', { name: /Upgrade now only \$10\.00 per month/ } ) - ).toBeTruthy(); -} ); - -test( 'hides the legacy upsell on offline sites', () => { - Jetpack_Boost.site.online = false; - render( ); - expect( - screen.queryByRole( 'button', { name: /Upgrade now only \$10\.00 per month/ } ) - ).toBeNull(); -} ); diff --git a/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/upgrade-cta.tsx b/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/upgrade-cta.tsx deleted file mode 100644 index 3404768904c1..000000000000 --- a/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/upgrade-cta.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import { getCurrencyObject } from '@automattic/number-formatters'; -import { __, sprintf } from '@wordpress/i18n'; -import RightArrow from '$svg/right-arrow'; -import { recordBoostEvent } from '$lib/utils/analytics'; -import styles from './upgrade-cta.module.scss'; -import { usePricing } from '$lib/stores/pricing'; - -type UpgradeCTAProps = { - description: string; - identifier: string; - eventName?: string; - onClick?: () => void; -}; - -const UpgradeCTA = ( { - description, - identifier, - onClick, - eventName = 'upsell_cta_from_settings_page_in_plugin', -}: UpgradeCTAProps ) => { - // No need to show the upgrade CTA if the site is unreachable. - if ( ! Jetpack_Boost.site.online ) { - return null; - } - - const onClickHandler = () => { - recordBoostEvent( eventName, { identifier } ); - - if ( onClick ) { - onClick(); - } - }; - - const pricing = usePricing(); - const currencyObjectAfter = ! pricing - ? null - : getCurrencyObject( pricing.priceAfter / 12, pricing.currencyCode ); - const priceString = currencyObjectAfter - ? currencyObjectAfter.symbol + currencyObjectAfter.integer + currencyObjectAfter.fraction - : '_'; - - return ( - - ); -}; - -export default UpgradeCTA; diff --git a/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/upgrade-notice.test.tsx b/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/upgrade-notice.test.tsx index 1e1323abffd3..8be865d2cec4 100644 --- a/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/upgrade-notice.test.tsx +++ b/projects/plugins/boost/app/assets/src/js/features/upgrade-cta/upgrade-notice.test.tsx @@ -9,10 +9,6 @@ jest.mock( '$lib/utils/analytics', () => ( { recordBoostEvent: jest.fn(), recordBoostEventAndRedirect: jest.fn(), } ) ); -jest.mock( - '@automattic/jetpack-my-jetpack/components/product-interstitial/assets/boost.webp', - () => '' -); jest.mock( '$lib/stores/premium-features', () => ( { usePremiumFeatures: () => [] } ) ); jest.mock( 'jetpackConfig', () => ( { consumer_slug: 'jetpack-boost' } ), { virtual: true } ); diff --git a/projects/plugins/boost/app/assets/src/js/svg/right-arrow.tsx b/projects/plugins/boost/app/assets/src/js/svg/right-arrow.tsx deleted file mode 100644 index f894b8814ccc..000000000000 --- a/projects/plugins/boost/app/assets/src/js/svg/right-arrow.tsx +++ /dev/null @@ -1,7 +0,0 @@ -const RightArrow = () => ( - - - -); - -export default RightArrow; diff --git a/projects/plugins/boost/changelog/boost-remove-premium-tooltip b/projects/plugins/boost/changelog/boost-remove-premium-tooltip new file mode 100644 index 000000000000..50e86a9e169e --- /dev/null +++ b/projects/plugins/boost/changelog/boost-remove-premium-tooltip @@ -0,0 +1,5 @@ +Significance: patch +Type: removed +Comment: Remove upgrade tooltip components nothing renders since the legacy dashboard went. + + diff --git a/projects/plugins/boost/tests/e2e/eslint.config.mjs b/projects/plugins/boost/tests/e2e/eslint.config.mjs index a0dc75e494a8..941577308830 100644 --- a/projects/plugins/boost/tests/e2e/eslint.config.mjs +++ b/projects/plugins/boost/tests/e2e/eslint.config.mjs @@ -4,7 +4,10 @@ import { makeE2eConfig } from '@automattic/_jetpack-e2e-commons/eslint.config.mj export default [ ...makeE2eConfig( import.meta.url ), { - files: [ 'lib/fixtures/history-tooltip*', 'lib/fixtures/settings-tooltip*' ], + files: [ + 'lib/fixtures/history-tooltip*.{js,jsx,cjs}', + 'lib/fixtures/settings-tooltip*.{js,jsx,cjs}', + ], rules: { // The browser fixtures bundle the plugin using its declared build dependencies. 'import/no-extraneous-dependencies': [ @@ -14,7 +17,7 @@ export default [ }, }, { - files: [ 'lib/fixtures/settings-tooltip*' ], + files: [ 'lib/fixtures/settings-tooltip*.{js,jsx,cjs}' ], rules: { // This fixture reaches plugin sources through the `$…` aliases its webpack config // resolves, and loads its globals and stylesheets in a deliberate order. diff --git a/projects/plugins/boost/tests/e2e/lib/fixtures/settings-tooltip-cards.jsx b/projects/plugins/boost/tests/e2e/lib/fixtures/settings-tooltip-cards.jsx index aa6b6ba94a54..f3c7f420033a 100644 --- a/projects/plugins/boost/tests/e2e/lib/fixtures/settings-tooltip-cards.jsx +++ b/projects/plugins/boost/tests/e2e/lib/fixtures/settings-tooltip-cards.jsx @@ -2,8 +2,7 @@ import { IconTooltip } from '@automattic/jetpack-components'; import { image, pending } from '@wordpress/icons'; import { Card, CollapsibleCard, Icon, Stack } from '@wordpress/ui'; import { tooltipLayer } from '$features/module/tooltip-layer'; -import criticalCss from '$features/critical-css/critical-css-module/critical-css-module.module.scss'; -import tooltipStyles from '$features/premium-tooltip/premium-tooltip.module.scss'; +import fixtureStyles from './settings-tooltip-cards.module.scss'; import UpgradeNotice from '$features/upgrade-cta/upgrade-notice'; import styles from '../../../../app/assets/src/js/pages/settings/settings.module.scss'; @@ -34,8 +33,8 @@ const SettingsTooltip = () => ( title="Upgrade options" label="Upgrade information" placement="bottom" - className={ tooltipStyles.tooltip } - popoverClassName={ tooltipStyles.popover } + className={ fixtureStyles.tooltip } + popoverClassName={ fixtureStyles.popover } { ...tooltipLayer } iconSize={ 22 } wide @@ -52,7 +51,7 @@ const Settings = () => ( description="Manage how your page content is loaded for visitors." icon={ pending } > -
+

You should regenerate your Critical CSS whenever you make changes to the HTML or CSS structure of your site. diff --git a/projects/plugins/boost/tests/e2e/lib/fixtures/settings-tooltip-cards.module.scss b/projects/plugins/boost/tests/e2e/lib/fixtures/settings-tooltip-cards.module.scss new file mode 100644 index 000000000000..dc3325477597 --- /dev/null +++ b/projects/plugins/boost/tests/e2e/lib/fixtures/settings-tooltip-cards.module.scss @@ -0,0 +1,48 @@ +// Sizes the fixture tooltip as a wide, CTA-holding worst case, so the +// clipping checks have something to catch. +.wrapper { + margin-block: 1em; + + p { + display: inline; + } +} + +@media (max-width: 768px) { + + .wrapper :global(.icon-tooltip-wrapper) { + display: block; + margin-inline-start: 50%; + inset-inline-start: -12px; + } +} + +.tooltip { + margin-inline-start: 6px; + line-height: 24px; + + svg { + position: absolute; + inset-inline-start: 0; + inset-block-end: 0; + fill: #8c8f94; + } +} + +// `wide` only reaches an inline popover, so restate its width here. +.popover:global(.components-popover.icon-tooltip-container) :global(.components-popover__content) { + width: 440px; +} + +.popover :global(.icon-tooltip-title) { + margin-block-end: 20px; + color: #23282d; + font-weight: 600; + font-size: 20px; + line-height: 1.3; +} + +.popover :global(.icon-tooltip-content) { + font-size: 16px; + color: #2c3338; +} diff --git a/projects/plugins/boost/tests/e2e/lib/fixtures/settings-tooltip-upgrade-cta.jsx b/projects/plugins/boost/tests/e2e/lib/fixtures/settings-tooltip-upgrade-cta.jsx deleted file mode 100644 index 29c001170d85..000000000000 --- a/projects/plugins/boost/tests/e2e/lib/fixtures/settings-tooltip-upgrade-cta.jsx +++ /dev/null @@ -1,10 +0,0 @@ -import UpgradeCTA from '$features/upgrade-cta/upgrade-cta'; - -// Stands in for InterstitialModalCTA, whose My Jetpack modal needs My Jetpack's -// product state. Renders the same button it renders when closed, which is the -// only part of it the tooltip shows. -const InterstitialModalCTA = ( { description = '', identifier } ) => ( - -); - -export default InterstitialModalCTA; diff --git a/projects/plugins/boost/tests/e2e/lib/fixtures/settings-tooltip.webpack.cjs b/projects/plugins/boost/tests/e2e/lib/fixtures/settings-tooltip.webpack.cjs index b1a2e556499b..b2fe51d698fe 100644 --- a/projects/plugins/boost/tests/e2e/lib/fixtures/settings-tooltip.webpack.cjs +++ b/projects/plugins/boost/tests/e2e/lib/fixtures/settings-tooltip.webpack.cjs @@ -33,10 +33,6 @@ module.exports = { __dirname, 'settings-tooltip-cards.jsx' ), - [ path.join( - pluginRoot, - 'app/assets/src/js/features/upgrade-cta/interstitial-modal-cta.tsx' - ) ]: path.join( __dirname, 'settings-tooltip-upgrade-cta.jsx' ), }, fallback: { ...config.resolve.fallback, url: false, https: false, http: false, os: false }, }, diff --git a/projects/plugins/boost/tests/e2e/specs/base/modern-settings-tooltip-clip.test.ts b/projects/plugins/boost/tests/e2e/specs/base/modern-settings-tooltip-clip.test.ts index e3e46d2204bb..94141fe6a13e 100644 --- a/projects/plugins/boost/tests/e2e/specs/base/modern-settings-tooltip-clip.test.ts +++ b/projects/plugins/boost/tests/e2e/specs/base/modern-settings-tooltip-clip.test.ts @@ -198,28 +198,3 @@ test( 'holding Enter on the fixture tooltip leaves it open', async ( { page } ) } await page.keyboard.up( 'Enter' ); } ); - -test( 'the fixture tooltip rings its icon when focused, like other WordPress buttons', async ( { - page, -} ) => { - await page.setViewportSize( { width: 1440, height: 900 } ); - await page.goto( 'http://boost-settings.test/' ); - const trigger = page.locator( '.icon-tooltip-wrapper button' ).first(); - const icon = trigger.locator( 'svg' ); - - await expect( async () => { - await page.keyboard.press( 'Tab' ); - await expect( trigger ).toBeFocused( { timeout: 100 } ); - } ).toPass( { intervals: [ 0 ], timeout: 10000 } ); - await expect( icon ).toHaveCSS( 'outline-style', 'solid' ); - - // A mouse press focuses the button too; the ring appears once it is released. - await page.reload(); - const box = ( await icon.boundingBox() )!; - await page.mouse.move( box.x + box.width / 2, box.y + box.height / 2 ); - await page.mouse.down(); - await expect( trigger ).toBeFocused(); - await expect( icon ).toHaveCSS( 'outline-style', 'none' ); - await page.mouse.up(); - await expect( icon ).toHaveCSS( 'outline-style', 'solid' ); -} );