Skip to content

Commit

Permalink
remove test that no longer applies
Browse files Browse the repository at this point in the history
  • Loading branch information
vykes-mac committed Feb 27, 2025
1 parent 7645b7a commit abb131a
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions client/my-sites/customer-home/test/customer-home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,13 @@ import { screen, waitFor } from '@testing-library/react';
import apiFetch from '@wordpress/api-fetch';
import nock from 'nock';
import React, { act } from 'react';
import { loadExperimentAssignment } from 'calypso/lib/explat';
import { reducer as ui } from 'calypso/state/ui/reducer';
import { renderWithProvider } from 'calypso/test-helpers/testing-library';
import CustomerHome from '../main';
import type { SiteDetails } from '@automattic/data-stores';

jest.mock( '@wordpress/api-fetch' );

let mockUseExperimentResult = [ false, true ];

jest.mock( 'calypso/lib/explat', () => ( {
loadExperimentAssignment: jest.fn( ( slug ) =>
slug === 'calypso_signup_onboarding_goals_first_flow_holdout_v2_20250131'
? Promise.resolve( { variationName: 'treatment_cumulative' } )
: Promise.reject( new Error( `Unmocked experiment slug: ${ slug }` ) )
),
useExperiment: jest.fn( () => mockUseExperimentResult ),
} ) );

jest.mock( '../components/home-content', () => () => (
<div data-testid="home-content">Home Content</div>
) );
Expand Down Expand Up @@ -162,33 +150,4 @@ describe( 'CustomerHome', () => {

expect( await screen.findByText( 'Congrats, your site is live!' ) ).toBeInTheDocument();
} );

it( 'shows home content when site would be eligible to show launchpad, but user is in control group', async () => {
const testSite = makeTestSite( {
launch_status: 'unlaunched',
options: { site_creation_flow: 'onboarding', launchpad_screen: false },
} );
( loadExperimentAssignment as jest.Mock ).mockResolvedValue( { variationName: 'control' } );

renderWithProvider( <CustomerHome site={ testSite } /> );

await waitFor( () => expect( screen.getByTestId( 'home-content' ) ).toBeInTheDocument() );
expect( screen.queryByTestId( 'launchpad-first' ) ).not.toBeInTheDocument();
} );

it( 'shows home content when site would be eligible to show launchpad, but user is in treatment_frozen group', async () => {
mockUseExperimentResult = [ false, false ];
const testSite = makeTestSite( {
launch_status: 'unlaunched',
options: { site_creation_flow: 'onboarding', launchpad_screen: false },
} );
( loadExperimentAssignment as jest.Mock ).mockResolvedValue( {
variationName: 'treatment_frozen',
} );

renderWithProvider( <CustomerHome site={ testSite } /> );

await waitFor( () => expect( screen.getByTestId( 'home-content' ) ).toBeInTheDocument() );
expect( screen.queryByTestId( 'launchpad-first' ) ).not.toBeInTheDocument();
} );
} );

0 comments on commit abb131a

Please sign in to comment.