@@ -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' ;
6562import { provideKeyMetricsWidgetRegistrations } from '@/js/components/KeyMetrics/test-utils' ;
6663import * as analytics4Fixtures from '@/js/modules/analytics-4/datastore/__fixtures__' ;
6764import {
@@ -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