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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
8 additions and
1 deletions
-
components/timeline/TimelineItemList.tsx
-
components/timeline/__tests__/index.test.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), |
|
|
|
])} |
|
|
|
|
|
@ -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']; |
|
|
|
|
|
|
|