@@ -14,6 +14,7 @@ import { SceneVariableSet } from '../sets/SceneVariableSet';
14
14
import userEvent from '@testing-library/user-event' ;
15
15
import { TestContextProvider } from '../../../utils/test/TestContextProvider' ;
16
16
import { FiltersRequestEnricher } from '../../core/types' ;
17
+ import { allActiveGroupByVariables } from './findActiveGroupByVariablesByUid' ;
17
18
18
19
// 11.1.2 - will use SafeSerializableSceneObject
19
20
// 11.1.1 - will NOT use SafeSerializableSceneObject
@@ -259,8 +260,25 @@ describe.each(['11.1.2', '11.1.1'])('GroupByVariable', (v) => {
259
260
} ) ;
260
261
} ) ;
261
262
263
+ it ( 'does NOT call addActivationHandler when applyMode is manual' , async ( ) => {
264
+ allActiveGroupByVariables . clear ( ) ;
265
+
266
+ const { variable } = setupTest ( {
267
+ applyMode : 'manual' ,
268
+ } ) ;
269
+
270
+ const addActivationHandlerSpy = jest . spyOn ( variable , 'addActivationHandler' ) ;
271
+
272
+ await act ( async ( ) => {
273
+ await lastValueFrom ( variable . validateAndUpdate ( ) ) ;
274
+ } ) ;
275
+
276
+ expect ( addActivationHandlerSpy ) . not . toHaveBeenCalled ( ) ;
277
+ expect ( allActiveGroupByVariables . size ) . toBe ( 0 ) ;
278
+ } ) ;
279
+
262
280
// TODO enable once this repo is using @grafana /[email protected]
263
- it . skip ( 'shows groups and orders according to first occurence of a group item' , async ( ) => {
281
+ it . skip ( 'shows groups and orders according to first occurrence of a group item' , async ( ) => {
264
282
const { runRequest } = setupTest ( {
265
283
getTagKeysProvider : async ( ) => ( {
266
284
replace : true ,
0 commit comments