mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Panels: Fixed issue with panel type change and data updates (#16871)
This commit is contained in:
@@ -87,7 +87,10 @@ describe('PanelModel', () => {
|
||||
});
|
||||
|
||||
describe('when changing panel type', () => {
|
||||
let panelQueryRunner: any;
|
||||
|
||||
beforeEach(() => {
|
||||
panelQueryRunner = model.getQueryRunner();
|
||||
model.changePlugin(getPanelPlugin({ id: 'graph' }));
|
||||
model.alert = { id: 2 };
|
||||
});
|
||||
@@ -105,6 +108,11 @@ describe('PanelModel', () => {
|
||||
model.changePlugin(getPanelPlugin({ id: 'table' }));
|
||||
expect(model.alert).toBe(undefined);
|
||||
});
|
||||
|
||||
it('getQueryRunner() should return same instance after plugin change', () => {
|
||||
const sameQueryRunner = model.getQueryRunner();
|
||||
expect(panelQueryRunner).toBe(sameQueryRunner);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when changing from angular panel', () => {
|
||||
|
||||
Reference in New Issue
Block a user