Browse Source

fix(TimeLine): Correct className (#40700)

Co-authored-by: WB780012 <wb-lhf780012@antgroup.com>
pull/40712/head
@linhf2023 2 years ago
committed by GitHub
parent
commit
fb5305d4c6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      components/timeline/TimelineItemList.tsx
  2. 8
      components/timeline/__tests__/index.test.tsx

1
components/timeline/TimelineItemList.tsx

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

8
components/timeline/__tests__/index.test.tsx

@ -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…
Cancel
Save