mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Logs: Move button to load logs volume to logs options header (#40578)
* Move button to load logs volume to logs options header * Update snapshot * Do not show load logs volume button when data source does not support it
This commit is contained in:
@@ -6,7 +6,6 @@ import { SecondaryActions } from './SecondaryActions';
|
||||
const addQueryRowButtonSelector = '[aria-label="Add row button"]';
|
||||
const richHistoryButtonSelector = '[aria-label="Rich history button"]';
|
||||
const queryInspectorButtonSelector = '[aria-label="Query inspector button"]';
|
||||
const onClickLoadLogsVolumeSelector = '[aria-label="Load logs volume button"]';
|
||||
|
||||
describe('SecondaryActions', () => {
|
||||
it('should render component two buttons', () => {
|
||||
@@ -15,7 +14,6 @@ describe('SecondaryActions', () => {
|
||||
onClickAddQueryRowButton={noop}
|
||||
onClickRichHistoryButton={noop}
|
||||
onClickQueryInspectorButton={noop}
|
||||
onClickLoadLogsVolume={noop}
|
||||
/>
|
||||
);
|
||||
expect(wrapper.find(addQueryRowButtonSelector)).toHaveLength(1);
|
||||
@@ -29,7 +27,6 @@ describe('SecondaryActions', () => {
|
||||
onClickAddQueryRowButton={noop}
|
||||
onClickRichHistoryButton={noop}
|
||||
onClickQueryInspectorButton={noop}
|
||||
onClickLoadLogsVolume={noop}
|
||||
/>
|
||||
);
|
||||
expect(wrapper.find(addQueryRowButtonSelector)).toHaveLength(0);
|
||||
@@ -43,7 +40,6 @@ describe('SecondaryActions', () => {
|
||||
onClickAddQueryRowButton={noop}
|
||||
onClickRichHistoryButton={noop}
|
||||
onClickQueryInspectorButton={noop}
|
||||
onClickLoadLogsVolume={noop}
|
||||
/>
|
||||
);
|
||||
expect(wrapper.find(addQueryRowButtonSelector).props().disabled).toBe(true);
|
||||
@@ -53,14 +49,11 @@ describe('SecondaryActions', () => {
|
||||
const onClickAddRow = jest.fn();
|
||||
const onClickHistory = jest.fn();
|
||||
const onClickQueryInspector = jest.fn();
|
||||
const onClickLoadLogsVolumeInspector = jest.fn();
|
||||
const wrapper = shallow(
|
||||
<SecondaryActions
|
||||
onClickAddQueryRowButton={onClickAddRow}
|
||||
onClickRichHistoryButton={onClickHistory}
|
||||
onClickQueryInspectorButton={onClickQueryInspector}
|
||||
loadingLogsVolumeAvailable={true}
|
||||
onClickLoadLogsVolume={onClickLoadLogsVolumeInspector}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -72,8 +65,5 @@ describe('SecondaryActions', () => {
|
||||
|
||||
wrapper.find(queryInspectorButtonSelector).simulate('click');
|
||||
expect(onClickQueryInspector).toBeCalled();
|
||||
|
||||
wrapper.find(onClickLoadLogsVolumeSelector).simulate('click');
|
||||
expect(onClickQueryInspector).toBeCalled();
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user