💄 prettier codes

This commit is contained in:
afc163 2019-03-06 13:45:40 +08:00
parent f882c13e80
commit 881dce9a3e
No known key found for this signature in database
GPG Key ID: 738F973FCE5C6B48
4 changed files with 26 additions and 14 deletions

View File

@ -7,7 +7,7 @@ describe('Collapse', () => {
const wrapper = mount( const wrapper = mount(
<Collapse expandIcon={() => null}> <Collapse expandIcon={() => null}>
<Collapse.Panel header="header" /> <Collapse.Panel header="header" />
</Collapse> </Collapse>,
); );
expect(wrapper.render()).toMatchSnapshot(); expect(wrapper.render()).toMatchSnapshot();
}); });
@ -17,7 +17,7 @@ describe('Collapse', () => {
<Collapse> <Collapse>
<Collapse.Panel header="header" extra={<button type="button">action</button>} /> <Collapse.Panel header="header" extra={<button type="button">action</button>} />
<Collapse.Panel header="header" extra={<button type="button">action</button>} /> <Collapse.Panel header="header" extra={<button type="button">action</button>} />
</Collapse> </Collapse>,
); );
expect(wrapper.render()).toMatchSnapshot(); expect(wrapper.render()).toMatchSnapshot();
}); });

View File

@ -1,11 +1,14 @@
import * as moment from 'moment'; import * as moment from 'moment';
export function formatDate(value: moment.Moment | undefined | null, format: string | string[]): string { export function formatDate(
if (!value) { value: moment.Moment | undefined | null,
return ''; format: string | string[],
} ): string {
if (Array.isArray(format)) { if (!value) {
format = format[0]; return '';
} }
return value.format(format); if (Array.isArray(format)) {
format = format[0];
}
return value.format(format);
} }

View File

@ -205,7 +205,10 @@ describe('Input.Password', () => {
it('should keep focus state', () => { it('should keep focus state', () => {
const wrapper = mount(<Input.Password defaultValue="111" autoFocus />); const wrapper = mount(<Input.Password defaultValue="111" autoFocus />);
expect(document.activeElement).toBe( expect(document.activeElement).toBe(
wrapper.find('input').at(0).getDOMNode() wrapper
.find('input')
.at(0)
.getDOMNode(),
); );
wrapper wrapper
.find('.ant-input-password-icon') .find('.ant-input-password-icon')
@ -216,7 +219,10 @@ describe('Input.Password', () => {
.at(0) .at(0)
.simulate('click'); .simulate('click');
expect(document.activeElement).toBe( expect(document.activeElement).toBe(
wrapper.find('input').at(0).getDOMNode() wrapper
.find('input')
.at(0)
.getDOMNode(),
); );
}); });
}); });
@ -306,7 +312,10 @@ describe('Input allowClear', () => {
.at(0) .at(0)
.simulate('click'); .simulate('click');
expect(document.activeElement).toBe( expect(document.activeElement).toBe(
wrapper.find('input').at(0).getDOMNode() wrapper
.find('input')
.at(0)
.getDOMNode(),
); );
}); });
}); });

View File

@ -5,4 +5,4 @@ export function validProgress(progress: number | undefined) {
return 100; return 100;
} }
return progress; return progress;
}; }