diff --git a/packages/grafana-ui/src/components/DataSourceSettings/CustomHeadersSettings.test.tsx b/packages/grafana-ui/src/components/DataSourceSettings/CustomHeadersSettings.test.tsx index 2848cbdbfbf..4dacf41b895 100644 --- a/packages/grafana-ui/src/components/DataSourceSettings/CustomHeadersSettings.test.tsx +++ b/packages/grafana-ui/src/components/DataSourceSettings/CustomHeadersSettings.test.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { mount } from 'enzyme'; import { CustomHeadersSettings, Props } from './CustomHeadersSettings'; +import { Button } from '../Button'; const setup = (propOverrides?: object) => { const props: Props = { @@ -48,6 +49,11 @@ describe('Render', () => { expect(wrapper.find('SecretFormField').exists()).toBeTruthy(); }); + it('add header button should not submit the form', () => { + const wrapper = setup(); + expect(wrapper.find(Button).getDOMNode()).toHaveAttribute('type', 'button'); + }); + it('should remove a header', () => { const wrapper = setup({ dataSourceConfig: { diff --git a/packages/grafana-ui/src/components/DataSourceSettings/CustomHeadersSettings.tsx b/packages/grafana-ui/src/components/DataSourceSettings/CustomHeadersSettings.tsx index 78c0f12e452..7f8f8de05f7 100644 --- a/packages/grafana-ui/src/components/DataSourceSettings/CustomHeadersSettings.tsx +++ b/packages/grafana-ui/src/components/DataSourceSettings/CustomHeadersSettings.tsx @@ -206,6 +206,7 @@ export class CustomHeadersSettings extends PureComponent { {value && value.length > 0 && ( - )}