File tree Expand file tree Collapse file tree
components/email-reporting/notices
modules/analytics-4/components/audience-segmentation/settings/SettingsCardVisitorGroups Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ describe( 'SetupAnalyticsNotice', () => {
135135 slug : MODULE_SLUG_ANALYTICS_4 ,
136136 active : false ,
137137 connected : false ,
138+ disconnectedAt : false ,
138139 } ,
139140 ] ) ;
140141
@@ -144,9 +145,6 @@ describe( 'SetupAnalyticsNotice', () => {
144145 registry . dispatch ( CORE_SITE ) . receiveGetEmailReportingSettings ( {
145146 enabled : true ,
146147 } ) ;
147- registry
148- . dispatch ( CORE_SITE )
149- . receiveGetWasAnalytics4Connected ( { wasConnected : false } ) ;
150148
151149 fetchMock . getOnce ( fetchGetDismissedItems , { body : [ ] } ) ;
152150 fetchMock . postOnce ( fetchDismissItem , {
@@ -245,6 +243,7 @@ describe( 'SetupAnalyticsNotice', () => {
245243 slug : MODULE_SLUG_ANALYTICS_4 ,
246244 active : true ,
247245 connected : false ,
246+ disconnectedAt : false ,
248247 } ,
249248 ] ) ;
250249 provideModuleRegistrations ( registry ) ;
@@ -253,9 +252,6 @@ describe( 'SetupAnalyticsNotice', () => {
253252 registry . dispatch ( CORE_SITE ) . receiveGetEmailReportingSettings ( {
254253 enabled : true ,
255254 } ) ;
256- registry
257- . dispatch ( CORE_SITE )
258- . receiveGetWasAnalytics4Connected ( { wasConnected : false } ) ;
259255
260256 const moduleActivationEndpoint = RegExp (
261257 'google-site-kit/v1/core/modules/data/activation'
Original file line number Diff line number Diff line change @@ -158,10 +158,16 @@ describe( 'SettingsCardVisitorGroups', () => {
158158 audienceSegmentationSetupCompletedBy : null ,
159159 } ) ;
160160
161+ // Set available audiences directly to ensure the selector returns
162+ // the data without triggering a network request during save.
163+ registry
164+ . dispatch ( MODULES_ANALYTICS_4 )
165+ . setAvailableAudiences ( availableAudiences ) ;
166+
161167 fetchMock . post ( audienceSettingsEndpoint , ( url , opts ) => {
162168 const { data } = JSON . parse ( opts . body ) ;
163- // Return the same settings passed to the API .
164- return { body : data , status : 200 } ;
169+ // Return the settings object directly (not wrapped in data) .
170+ return { body : data . settings , status : 200 } ;
165171 } ) ;
166172 } ) ;
167173
You can’t perform that action at this time.
0 commit comments