chore: Button cruft cleanup (#11342)

* toggleSchedule

* cleaning up run query button

* removing unnecessary (subtle!) style overrides

* bulk action classname to button style prop

* nixing btn-primary

* nixing cancelQuery class

* togglesave

* nixing autocomplete class

* linting

* nixing button classes of 'ok' and 'reset'

* unoing diagnostic test

* begrudgingly adding an m-r-3 class... for now

* this is not a class to worry about

* test fixes for limit control

* updating TODO notes, calling it a day for now.

* gah... copy paste error.
This commit is contained in:
Evan Rusackas
2020-10-23 10:42:29 -07:00
committed by GitHub
parent ad88a06d61
commit efdda8b69e
13 changed files with 24 additions and 51 deletions

View File

@@ -99,7 +99,10 @@ describe('LimitControl', () => {
wrappingComponent: ThemeProvider,
wrappingComponentProps: { theme: supersetTheme },
});
popoverContentWrapper.find('.ok').first().simulate('click');
popoverContentWrapper
.find('[data-test="limit-control-confirm"]')
.first()
.simulate('click');
expect(wrapper.state().showOverlay).toBe(false);
});
it('resets and closes', () => {
@@ -114,7 +117,10 @@ describe('LimitControl', () => {
wrappingComponent: ThemeProvider,
wrappingComponentProps: { theme: supersetTheme },
});
popoverContentWrapper.find('.reset').first().simulate('click');
popoverContentWrapper
.find('[data-test="limit-control-cancel"]')
.first()
.simulate('click');
expect(wrapper.state().textValue).toEqual(
defaultProps.defaultQueryLimit.toString(),
);

View File

@@ -48,7 +48,7 @@ describe('SavedQuery', () => {
const wrapper = shallow(<SaveQuery {...mockedProps} />);
const modal = wrapper.find(Modal);
expect(modal.find('.cancelQuery')).toHaveLength(1);
expect(modal.find('[data-test="cancel-query"]')).toHaveLength(1);
});
it('has 2 FormControls', () => {
const wrapper = shallow(<SaveQuery {...mockedProps} />);

View File

@@ -108,7 +108,7 @@ describe('SqlEditor', () => {
it('allows toggling autocomplete', () => {
const wrapper = shallow(<SqlEditor {...mockedProps} />);
expect(wrapper.find(AceEditorWrapper).props().autocomplete).toBe(true);
wrapper.find('.autocomplete').simulate('click');
wrapper.find('[data-test="autocomplete"]').simulate('click');
expect(wrapper.find(AceEditorWrapper).props().autocomplete).toBe(false);
});
});