Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue / 9633 Rename ACRSubtleNotification Component to ConversionReportingSettingsSubtleNotification #9693

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* ACRSubtleNotification component.
* ConversionReportingSettingsSubtleNotification component.
*
* Site Kit by Google, Copyright 2024 Google LLC
*
Expand Down Expand Up @@ -33,7 +33,7 @@ import { CORE_USER } from '../../googlesitekit/datastore/user/constants';
import { ACR_SUBTLE_NOTIFICATION_SLUG } from './constants';
import { CORE_SITE } from '../../googlesitekit/datastore/site/constants';

export default function ACRSubtleNotification() {
export default function ConversionReportingSettingsSubtleNotification() {
const [ isNavigating, setIsNavigating ] = useState( false );

const { dismissItem } = useDispatch( CORE_USER );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Key Metrics ACRSubtleNotification component tests.
* Key Metrics ConversionReportingSettingsSubtleNotification component tests.
*
* Site Kit by Google, Copyright 2024 Google LLC
*
Expand All @@ -24,10 +24,10 @@ import {
render,
} from '../../../../tests/js/test-utils';
import { CORE_USER } from '../../googlesitekit/datastore/user/constants';
import ACRSubtleNotification from './ACRSubtleNotification';
import ConversionReportingSettingsSubtleNotification from './ConversionReportingSettingsSubtleNotification';
import { ACR_SUBTLE_NOTIFICATION_SLUG } from './constants';

describe( 'ACRSubtleNotification', () => {
describe( 'ConversionReportingSettingsSubtleNotification', () => {
let registry;

beforeEach( () => {
Expand All @@ -38,7 +38,7 @@ describe( 'ACRSubtleNotification', () => {

it( 'should render "Get tailored metrics" CTA', async () => {
const { queryByText, getByRole, waitForRegistry } = render(
<ACRSubtleNotification />,
<ConversionReportingSettingsSubtleNotification />,
{
registry,
}
Expand All @@ -56,9 +56,12 @@ describe( 'ACRSubtleNotification', () => {
} );

it( 'should render "Maybe later" CTA', () => {
const { queryByText } = render( <ACRSubtleNotification />, {
registry,
} );
const { queryByText } = render(
<ConversionReportingSettingsSubtleNotification />,
{
registry,
}
);

expect( queryByText( /maybe later/i ) ).toBeInTheDocument();
} );
Expand All @@ -72,9 +75,12 @@ describe( 'ACRSubtleNotification', () => {
}
);

const { getByRole } = render( <ACRSubtleNotification />, {
registry,
} );
const { getByRole } = render(
<ConversionReportingSettingsSubtleNotification />,
{
registry,
}
);

// eslint-disable-next-line require-await
await act( async () => {
Expand Down
4 changes: 2 additions & 2 deletions assets/js/components/settings/SettingsCardKeyMetrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { CORE_USER } from '../../googlesitekit/datastore/user/constants';
import { CORE_SITE } from '../../googlesitekit/datastore/site/constants';
import { ACR_SUBTLE_NOTIFICATION_SLUG } from '../KeyMetrics/constants';
import { WEEK_IN_SECONDS, trackEvent } from '../../util';
import ACRSubtleNotification from '../KeyMetrics/ACRSubtleNotification';
import ConversionReportingSettingsSubtleNotification from '../KeyMetrics/ConversionReportingSettingsSubtleNotification';
import SettingsKeyMetrics from './SettingsKeyMetrics';
import UserInputPreview from '../user-input/UserInputPreview';
import Layout from '../layout/Layout';
Expand Down Expand Up @@ -127,7 +127,7 @@ export default function SettingsCardKeyMetrics() {
<SettingsKeyMetrics />
{ showACRNotification && (
<Fragment>
<ACRSubtleNotification />
<ConversionReportingSettingsSubtleNotification />
{ inView && (
<SurveyViewTrigger
triggerID="view_kmw_setup_cta"
Expand Down
14 changes: 7 additions & 7 deletions assets/js/components/settings/SettingsCardKeyMetrics.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe( 'SettingsCardKeyMetrics', () => {
);
} );

it( 'should show ACRSubtleNotification when Key metrics are not setup', async () => {
it( 'should show ConversionReportingSettingsSubtleNotification when Key metrics are not setup', async () => {
await registry
.dispatch( CORE_USER )
.receiveIsUserInputCompleted( false );
Expand All @@ -92,7 +92,7 @@ describe( 'SettingsCardKeyMetrics', () => {
).toBeInTheDocument();
} );

it( 'should show ACRSubtleNotification when Key metrics are setup manually', async () => {
it( 'should show ConversionReportingSettingsSubtleNotification when Key metrics are setup manually', async () => {
await registry
.dispatch( CORE_USER )
.receiveIsUserInputCompleted( false );
Expand All @@ -113,14 +113,14 @@ describe( 'SettingsCardKeyMetrics', () => {
container.querySelector( '.googlesitekit-acr-subtle-notification' )
).toBeInTheDocument();

// Default content should be replaced with ACRSubtleNotification, so it should
// not be shown at the same time as ACR notification.
// Default content should be replaced with ConversionReportingSettingsSubtleNotification,
// so it should not be shown at the same time as ACR notification.
expect(
container.querySelector( '.googlesitekit-user-input__notification' )
).not.toBeInTheDocument();
} );

it( 'should not show ACRSubtleNotification when Key metrics are setup using tailored metrics', async () => {
it( 'should not show ConversionReportingSettingsSubtleNotification when Key metrics are setup using tailored metrics', async () => {
await registry
.dispatch( CORE_USER )
.receiveIsUserInputCompleted( true );
Expand All @@ -140,7 +140,7 @@ describe( 'SettingsCardKeyMetrics', () => {
).not.toBeInTheDocument();
} );

it( 'should not show ACRSubtleNotification if it was previously dismissed', async () => {
it( 'should not show ConversionReportingSettingsSubtleNotification if it was previously dismissed', async () => {
registry
.dispatch( CORE_USER )
.receiveGetDismissedItems( [ ACR_SUBTLE_NOTIFICATION_SLUG ] );
Expand All @@ -164,7 +164,7 @@ describe( 'SettingsCardKeyMetrics', () => {
).not.toBeInTheDocument();
} );

it( 'should not show ACRSubtleNotification if conversionReporting feature flag is not enabled', async () => {
it( 'should not show ConversionReportingSettingsSubtleNotification if conversionReporting feature flag is not enabled', async () => {
await registry
.dispatch( CORE_USER )
.receiveIsUserInputCompleted( false );
Expand Down
Loading