mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
Prettify the frontend code (#8648)
* Add Prettier global configs * Format js/jsx/ts/tsx/less files
This commit is contained in:
@@ -35,14 +35,10 @@ describe('SavedQuery', () => {
|
||||
animation: false,
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<SaveQuery />),
|
||||
).toBe(true);
|
||||
expect(React.isValidElement(<SaveQuery />)).toBe(true);
|
||||
});
|
||||
it('is valid with props', () => {
|
||||
expect(
|
||||
React.isValidElement(<SaveQuery {...mockedProps} />),
|
||||
).toBe(true);
|
||||
expect(React.isValidElement(<SaveQuery {...mockedProps} />)).toBe(true);
|
||||
});
|
||||
it('has a ModalTrigger', () => {
|
||||
const wrapper = shallow(<SaveQuery {...mockedProps} />);
|
||||
@@ -63,7 +59,10 @@ describe('SavedQuery', () => {
|
||||
const wrapper = shallow(<SaveQuery {...mockedProps} onSave={saveSpy} />);
|
||||
const modal = shallow(wrapper.instance().renderModalBody());
|
||||
expect(modal.find(Button)).toHaveLength(2);
|
||||
modal.find(Button).at(0).simulate('click');
|
||||
modal
|
||||
.find(Button)
|
||||
.at(0)
|
||||
.simulate('click');
|
||||
expect(saveSpy.calledOnce).toBe(true);
|
||||
});
|
||||
it('has an update button if this is an existing query', () => {
|
||||
@@ -78,7 +77,10 @@ describe('SavedQuery', () => {
|
||||
const wrapper = shallow(<SaveQuery {...props} onUpdate={updateSpy} />);
|
||||
const modal = shallow(wrapper.instance().renderModalBody());
|
||||
expect(modal.find(Button)).toHaveLength(3);
|
||||
modal.find(Button).at(0).simulate('click');
|
||||
modal
|
||||
.find(Button)
|
||||
.at(0)
|
||||
.simulate('click');
|
||||
expect(updateSpy.calledOnce).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user