mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
Prettify the frontend code (#8648)
* Add Prettier global configs * Format js/jsx/ts/tsx/less files
This commit is contained in:
@@ -28,9 +28,7 @@ describe('App', () => {
|
||||
user,
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<App {...mockedProps} />),
|
||||
).toBe(true);
|
||||
expect(React.isValidElement(<App {...mockedProps} />)).toBe(true);
|
||||
});
|
||||
|
||||
it('renders 2 Col', () => {
|
||||
|
||||
@@ -35,12 +35,16 @@ describe('CreatedContent', () => {
|
||||
};
|
||||
|
||||
it('renders 2 TableLoader', () => {
|
||||
const wrapper = shallow(<CreatedContent {...mockedProps} />, { context: { store } });
|
||||
const wrapper = shallow(<CreatedContent {...mockedProps} />, {
|
||||
context: { store },
|
||||
});
|
||||
expect(wrapper.find(TableLoader)).toHaveLength(2);
|
||||
});
|
||||
|
||||
it('renders 2 titles', () => {
|
||||
const wrapper = shallow(<CreatedContent {...mockedProps} />, { context: { store } });
|
||||
const wrapper = shallow(<CreatedContent {...mockedProps} />, {
|
||||
context: { store },
|
||||
});
|
||||
expect(wrapper.find('h3')).toHaveLength(2);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -35,11 +35,11 @@ describe('EditableTitle', () => {
|
||||
},
|
||||
};
|
||||
const editableWrapper = shallow(<EditableTable {...mockProps} />);
|
||||
const notEditableWrapper = shallow(<EditableTable title="my title" onSaveTitle={callback} />);
|
||||
const notEditableWrapper = shallow(
|
||||
<EditableTable title="my title" onSaveTitle={callback} />,
|
||||
);
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<EditableTable {...mockProps} />),
|
||||
).toBe(true);
|
||||
expect(React.isValidElement(<EditableTable {...mockProps} />)).toBe(true);
|
||||
});
|
||||
it('should render title', () => {
|
||||
const titleElement = editableWrapper.find('input');
|
||||
|
||||
@@ -35,12 +35,16 @@ describe('Favorites', () => {
|
||||
};
|
||||
|
||||
it('renders 2 TableLoader', () => {
|
||||
const wrapper = shallow(<Favorites {...mockedProps} />, { context: { store } });
|
||||
const wrapper = shallow(<Favorites {...mockedProps} />, {
|
||||
context: { store },
|
||||
});
|
||||
expect(wrapper.find(TableLoader)).toHaveLength(2);
|
||||
});
|
||||
|
||||
it('renders 2 titles', () => {
|
||||
const wrapper = shallow(<Favorites {...mockedProps} />, { context: { store } });
|
||||
const wrapper = shallow(<Favorites {...mockedProps} />, {
|
||||
context: { store },
|
||||
});
|
||||
expect(wrapper.find('h3')).toHaveLength(2);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -28,9 +28,9 @@ describe('RecentActivity', () => {
|
||||
user,
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<RecentActivity {...mockedProps} />),
|
||||
).toBe(true);
|
||||
expect(React.isValidElement(<RecentActivity {...mockedProps} />)).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
it('renders a TableLoader', () => {
|
||||
|
||||
@@ -22,15 +22,12 @@ import { mount } from 'enzyme';
|
||||
import { user, userNoPerms } from './fixtures';
|
||||
import Security from '../../../src/profile/components/Security';
|
||||
|
||||
|
||||
describe('Security', () => {
|
||||
const mockedProps = {
|
||||
user,
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<Security {...mockedProps} />),
|
||||
).toBe(true);
|
||||
expect(React.isValidElement(<Security {...mockedProps} />)).toBe(true);
|
||||
});
|
||||
it('renders 2 role labels', () => {
|
||||
const wrapper = mount(<Security {...mockedProps} />);
|
||||
|
||||
@@ -24,15 +24,12 @@ import { mount } from 'enzyme';
|
||||
import { user } from './fixtures';
|
||||
import UserInfo from '../../../src/profile/components/UserInfo';
|
||||
|
||||
|
||||
describe('UserInfo', () => {
|
||||
const mockedProps = {
|
||||
user,
|
||||
};
|
||||
it('is valid', () => {
|
||||
expect(
|
||||
React.isValidElement(<UserInfo {...mockedProps} />),
|
||||
).toBe(true);
|
||||
expect(React.isValidElement(<UserInfo {...mockedProps} />)).toBe(true);
|
||||
});
|
||||
it('renders a Gravatar', () => {
|
||||
const wrapper = mount(<UserInfo {...mockedProps} />);
|
||||
|
||||
@@ -20,40 +20,16 @@ export const user = {
|
||||
username: 'alpha',
|
||||
roles: {
|
||||
Alpha: [
|
||||
[
|
||||
'can_this_form_post',
|
||||
'ResetMyPasswordView',
|
||||
],
|
||||
[
|
||||
'can_this_form_get',
|
||||
'ResetMyPasswordView',
|
||||
],
|
||||
[
|
||||
'can_this_form_post',
|
||||
'UserInfoEditView',
|
||||
],
|
||||
[
|
||||
'can_this_form_get',
|
||||
'UserInfoEditView',
|
||||
],
|
||||
['can_this_form_post', 'ResetMyPasswordView'],
|
||||
['can_this_form_get', 'ResetMyPasswordView'],
|
||||
['can_this_form_post', 'UserInfoEditView'],
|
||||
['can_this_form_get', 'UserInfoEditView'],
|
||||
],
|
||||
sql_lab: [
|
||||
[
|
||||
'menu_access',
|
||||
'SQL Lab',
|
||||
],
|
||||
[
|
||||
'can_sql_json',
|
||||
'Superset',
|
||||
],
|
||||
[
|
||||
'can_search_queries',
|
||||
'Superset',
|
||||
],
|
||||
[
|
||||
'can_csv',
|
||||
'Superset',
|
||||
],
|
||||
['menu_access', 'SQL Lab'],
|
||||
['can_sql_json', 'Superset'],
|
||||
['can_search_queries', 'Superset'],
|
||||
['can_csv', 'Superset'],
|
||||
],
|
||||
},
|
||||
firstName: 'alpha',
|
||||
|
||||
Reference in New Issue
Block a user