Skip to content

Commit 44e5a1d

Browse files
linhf123RedJue
authored andcommitted
fix(TimeLine): Correct className (ant-design#40700)
Co-authored-by: WB780012 <wb-lhf780012@antgroup.com>
1 parent 710c479 commit 44e5a1d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

components/timeline/TimelineItemList.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ const TimelineItemList: React.FC<TimelineProps & { hashId: string; direction?: s
5555
return (
5656
<TimelineItem
5757
className={classNames([
58-
className,
5958
!reverse && !!pending ? pendingClass : readyClass,
6059
getPositionCls(item?.position ?? '', idx),
6160
])}

components/timeline/__tests__/index.test.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,14 @@ describe('TimeLine', () => {
207207
expect(container.querySelector('.ant-timeline-item-label')).toHaveTextContent(label);
208208
});
209209

210+
it('TimeLine className should correctly', () => {
211+
const { container } = renderFactory({ className: 'timelineBox' });
212+
213+
expect(container.querySelector('.ant-timeline')).toHaveClass('timelineBox');
214+
215+
expect(container.querySelectorAll('li.ant-timeline-item')[0]).not.toHaveClass('timelineBox');
216+
});
217+
210218
describe('prop: color', () => {
211219
const presetColors = ['blue', 'red', 'green', 'gray'];
212220

0 commit comments

Comments
 (0)