mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Panel: Remove unnecessary test (#75994)
This commit is contained in:
parent
b94d06bfa7
commit
141485528d
@ -137,70 +137,6 @@ describe('PanelStateWrapper', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Panel row', () => {
|
|
||||||
it('should call query runner when it is not a row panel', async () => {
|
|
||||||
const subject: ReplaySubject<PanelData> = new ReplaySubject<PanelData>();
|
|
||||||
|
|
||||||
const panelQueryRunner = {
|
|
||||||
getData: () => subject,
|
|
||||||
run: jest.fn(),
|
|
||||||
} as unknown as PanelQueryRunner;
|
|
||||||
|
|
||||||
const options = {
|
|
||||||
panel: new PanelModel({
|
|
||||||
id: 123,
|
|
||||||
events: new EventBusSrv(),
|
|
||||||
getQueryRunner: () => panelQueryRunner,
|
|
||||||
getOptions: jest.fn(),
|
|
||||||
getDisplayTitle: jest.fn(),
|
|
||||||
}),
|
|
||||||
dashboard: {
|
|
||||||
panelInitialized: (panel: PanelModel) => panel.refresh(),
|
|
||||||
getTimezone: () => 'browser',
|
|
||||||
events: new EventBusSrv(),
|
|
||||||
canAddAnnotations: jest.fn(),
|
|
||||||
canEditAnnotations: jest.fn(),
|
|
||||||
canDeleteAnnotations: jest.fn(),
|
|
||||||
} as unknown as DashboardModel,
|
|
||||||
isInView: true,
|
|
||||||
};
|
|
||||||
const { props } = setupTestContext(options);
|
|
||||||
|
|
||||||
expect(props.panel.getQueryRunner().run).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
it('should not call query runner when it is a row panel', async () => {
|
|
||||||
const subject: ReplaySubject<PanelData> = new ReplaySubject<PanelData>();
|
|
||||||
|
|
||||||
const panelQueryRunner = {
|
|
||||||
getData: () => subject,
|
|
||||||
run: jest.fn(),
|
|
||||||
} as unknown as PanelQueryRunner;
|
|
||||||
|
|
||||||
const options = {
|
|
||||||
panel: new PanelModel({
|
|
||||||
id: 123,
|
|
||||||
events: new EventBusSrv(),
|
|
||||||
getQueryRunner: () => panelQueryRunner,
|
|
||||||
getOptions: jest.fn(),
|
|
||||||
getDisplayTitle: jest.fn(),
|
|
||||||
type: 'row',
|
|
||||||
}),
|
|
||||||
dashboard: {
|
|
||||||
panelInitialized: (panel: PanelModel) => panel.refresh(),
|
|
||||||
getTimezone: () => 'browser',
|
|
||||||
events: new EventBusSrv(),
|
|
||||||
canAddAnnotations: jest.fn(),
|
|
||||||
canEditAnnotations: jest.fn(),
|
|
||||||
canDeleteAnnotations: jest.fn(),
|
|
||||||
} as unknown as DashboardModel,
|
|
||||||
isInView: true,
|
|
||||||
};
|
|
||||||
const { props } = setupTestContext(options);
|
|
||||||
|
|
||||||
expect(props.panel.getQueryRunner().run).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const TestPanelComponent = () => <div>Plugin Panel to Render</div>;
|
const TestPanelComponent = () => <div>Plugin Panel to Render</div>;
|
||||||
|
Loading…
Reference in New Issue
Block a user