mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Explore: Unsync time ranges when a pane is closed (#61369)
* Explore: Unsync time ranges when a pane is closed * remove unintentional import
This commit is contained in:
parent
e8ef0395b1
commit
1e33e56dbd
@ -141,9 +141,10 @@ describe('Explore reducer', () => {
|
|||||||
left: rightItemMock,
|
left: rightItemMock,
|
||||||
maxedExploreId: undefined,
|
maxedExploreId: undefined,
|
||||||
right: undefined,
|
right: undefined,
|
||||||
|
syncedTimes: false,
|
||||||
} as unknown as ExploreState);
|
} as unknown as ExploreState);
|
||||||
});
|
});
|
||||||
it('should reset right pane when it is closed ', () => {
|
it('should reset right pane when it is closed', () => {
|
||||||
const leftItemMock = {
|
const leftItemMock = {
|
||||||
containerWidth: 100,
|
containerWidth: 100,
|
||||||
} as unknown as ExploreItemState;
|
} as unknown as ExploreItemState;
|
||||||
@ -167,6 +168,29 @@ describe('Explore reducer', () => {
|
|||||||
left: leftItemMock,
|
left: leftItemMock,
|
||||||
maxedExploreId: undefined,
|
maxedExploreId: undefined,
|
||||||
right: 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<ExploreState>()
|
||||||
|
.givenReducer(exploreReducer, initialState)
|
||||||
|
.whenActionIsDispatched(splitCloseAction({ itemId: ExploreId.right }))
|
||||||
|
.thenStateShouldEqual({
|
||||||
|
evenSplitPanes: true,
|
||||||
|
left: itemMock,
|
||||||
|
right: undefined,
|
||||||
|
syncedTimes: false,
|
||||||
} as unknown as ExploreState);
|
} as unknown as ExploreState);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -195,6 +195,7 @@ export const exploreReducer = (state = initialExploreState, action: AnyAction):
|
|||||||
largerExploreId: undefined,
|
largerExploreId: undefined,
|
||||||
maxedExploreId: undefined,
|
maxedExploreId: undefined,
|
||||||
evenSplitPanes: true,
|
evenSplitPanes: true,
|
||||||
|
syncedTimes: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user