diff --git a/public/app/features/explore/state/main.test.ts b/public/app/features/explore/state/main.test.ts index 3d868ff8bf2..f4450c6fe07 100644 --- a/public/app/features/explore/state/main.test.ts +++ b/public/app/features/explore/state/main.test.ts @@ -141,9 +141,10 @@ describe('Explore reducer', () => { left: rightItemMock, maxedExploreId: undefined, right: undefined, + syncedTimes: false, } as unknown as ExploreState); }); - it('should reset right pane when it is closed ', () => { + it('should reset right pane when it is closed', () => { const leftItemMock = { containerWidth: 100, } as unknown as ExploreItemState; @@ -167,6 +168,29 @@ describe('Explore reducer', () => { left: leftItemMock, maxedExploreId: undefined, right: undefined, + syncedTimes: false, + } as unknown as ExploreState); + }); + + it('should unsync time ranges', () => { + const itemMock = { + containerWidth: 100, + } as unknown as ExploreItemState; + + const initialState = { + left: itemMock, + right: itemMock, + syncedTimes: true, + } as unknown as ExploreState; + + reducerTester() + .givenReducer(exploreReducer, initialState) + .whenActionIsDispatched(splitCloseAction({ itemId: ExploreId.right })) + .thenStateShouldEqual({ + evenSplitPanes: true, + left: itemMock, + right: undefined, + syncedTimes: false, } as unknown as ExploreState); }); }); diff --git a/public/app/features/explore/state/main.ts b/public/app/features/explore/state/main.ts index b512d5c14b3..e052cd8fabf 100644 --- a/public/app/features/explore/state/main.ts +++ b/public/app/features/explore/state/main.ts @@ -195,6 +195,7 @@ export const exploreReducer = (state = initialExploreState, action: AnyAction): largerExploreId: undefined, maxedExploreId: undefined, evenSplitPanes: true, + syncedTimes: false, }; }