Panel: Remove unnecessary test (#75994)

This commit is contained in:
Juan Cabanas 2023-10-05 14:47:45 -03:00 committed by GitHub
parent b94d06bfa7
commit 141485528d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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>;