Skip to content

Commit f0b27e4

Browse files
committed
Address CR feedback.
1 parent cb1b7b8 commit f0b27e4

2 files changed

Lines changed: 9 additions & 12 deletions

File tree

assets/js/components/KeyMetrics/MetricsSelectionPanel/__snapshots__/index.test.js.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`MetricsSelectionPanel Header should match snapshot with setupFlowRefresh enabled 1`] = `
3+
exports[`MetricsSelectionPanel Header should render correctly 1`] = `
44
<body
55
class="googlesitekit-side-sheet-scroll-lock"
66
>
@@ -38,7 +38,7 @@ exports[`MetricsSelectionPanel Header should match snapshot with setupFlowRefres
3838
<p
3939
class="googlesitekit-typography googlesitekit-typography--body googlesitekit-typography--medium"
4040
>
41-
Edit your personalized goals in
41+
Edit your personalized goals or deactivate this widget in
4242
<button
4343
class="googlesitekit-cta-link googlesitekit-cta-link--secondary"
4444
>
@@ -301,7 +301,7 @@ exports[`MetricsSelectionPanel Header should match snapshot with setupFlowRefres
301301
</body>
302302
`;
303303

304-
exports[`MetricsSelectionPanel Header should render correctly 1`] = `
304+
exports[`MetricsSelectionPanel Header should render correctly with the \`setupFlowRefresh\` feature flag enabled 1`] = `
305305
<body
306306
class="googlesitekit-side-sheet-scroll-lock"
307307
>
@@ -339,7 +339,7 @@ exports[`MetricsSelectionPanel Header should render correctly 1`] = `
339339
<p
340340
class="googlesitekit-typography googlesitekit-typography--body googlesitekit-typography--medium"
341341
>
342-
Edit your personalized goals or deactivate this widget in
342+
Edit your personalized goals in
343343
<button
344344
class="googlesitekit-cta-link googlesitekit-cta-link--secondary"
345345
>

assets/js/components/KeyMetrics/MetricsSelectionPanel/index.test.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ import {
5858
KEY_METRICS_SELECTION_FORM,
5959
KEY_METRICS_SELECTION_PANEL_OPENED_KEY,
6060
} from '@/js/components/KeyMetrics/constants';
61-
import {
62-
VIEW_CONTEXT_MAIN_DASHBOARD,
63-
VIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY,
64-
} from '@/js/googlesitekit/constants';
61+
import { VIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY } from '@/js/googlesitekit/constants';
6562
import { provideKeyMetricsWidgetRegistrations } from '@/js/components/KeyMetrics/test-utils';
6663
import * as analytics4Fixtures from '@/js/modules/analytics-4/datastore/__fixtures__';
6764
import {
@@ -160,7 +157,7 @@ describe( 'MetricsSelectionPanel', () => {
160157
expect( document.body ).toMatchSnapshot();
161158
} );
162159

163-
it( 'should match snapshot with setupFlowRefresh enabled', async () => {
160+
it( 'should render correctly with the `setupFlowRefresh` feature flag enabled', async () => {
164161
const { waitForRegistry } = render( <MetricsSelectionPanel />, {
165162
registry,
166163
features: [ 'setupFlowRefresh' ],
@@ -188,20 +185,20 @@ describe( 'MetricsSelectionPanel', () => {
188185
);
189186
} );
190187

191-
it( 'should not display a settings link to edit personalized goals when `setupFlowRefresh` is enabled', async () => {
188+
it( 'should not display a settings link to edit personalized goals for a view-only user when `setupFlowRefresh` is enabled', async () => {
192189
const { container, waitForRegistry } = render(
193190
<MetricsSelectionPanel />,
194191
{
195192
registry,
196-
viewContext: VIEW_CONTEXT_MAIN_DASHBOARD,
193+
viewContext: VIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY,
197194
features: [ 'setupFlowRefresh' ],
198195
}
199196
);
200197

201198
await waitForRegistry();
202199

203200
expect( container ).not.toHaveTextContent(
204-
'Edit your personalized goals or deactivate this widget in'
201+
'Edit your personalized goals in'
205202
);
206203
} );
207204
} );

0 commit comments

Comments
 (0)