mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +08:00
fix(TimeLine): Correct className (#40700)
Co-authored-by: WB780012 <wb-lhf780012@antgroup.com>
This commit is contained in:
parent
c885a42e3b
commit
fb5305d4c6
@ -55,7 +55,6 @@ const TimelineItemList: React.FC<TimelineProps & { hashId: string; direction?: s
|
||||
return (
|
||||
<TimelineItem
|
||||
className={classNames([
|
||||
className,
|
||||
!reverse && !!pending ? pendingClass : readyClass,
|
||||
getPositionCls(item?.position ?? '', idx),
|
||||
])}
|
||||
|
@ -207,6 +207,14 @@ describe('TimeLine', () => {
|
||||
expect(container.querySelector('.ant-timeline-item-label')).toHaveTextContent(label);
|
||||
});
|
||||
|
||||
it('TimeLine className should correctly', () => {
|
||||
const { container } = renderFactory({ className: 'timelineBox' });
|
||||
|
||||
expect(container.querySelector('.ant-timeline')).toHaveClass('timelineBox');
|
||||
|
||||
expect(container.querySelectorAll('li.ant-timeline-item')[0]).not.toHaveClass('timelineBox');
|
||||
});
|
||||
|
||||
describe('prop: color', () => {
|
||||
const presetColors = ['blue', 'red', 'green', 'gray'];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user