mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-12 12:23:08 +08:00
💄 prettier codes
This commit is contained in:
parent
f882c13e80
commit
881dce9a3e
@ -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();
|
||||||
});
|
});
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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(),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -5,4 +5,4 @@ export function validProgress(progress: number | undefined) {
|
|||||||
return 100;
|
return 100;
|
||||||
}
|
}
|
||||||
return progress;
|
return progress;
|
||||||
};
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user