fix(TimeLine): Correct className (#40700)

Co-authored-by: WB780012 <wb-lhf780012@antgroup.com>
This commit is contained in:
@linhf2023 2023-02-13 15:41:47 +08:00 committed by GitHub
parent c885a42e3b
commit fb5305d4c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -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),
])}

View File

@ -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'];