From ae2eb13f830552e8657fb326a71270405d76c9d2 Mon Sep 17 00:00:00 2001 From: Sepush Date: Mon, 7 Mar 2022 10:20:59 +0800 Subject: [PATCH] test(timeline): test `lineType` prop (#2566) --- src/timeline/tests/Timeline.spec.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/timeline/tests/Timeline.spec.ts b/src/timeline/tests/Timeline.spec.ts index 96f18e830d2..4801d72926b 100644 --- a/src/timeline/tests/Timeline.spec.ts +++ b/src/timeline/tests/Timeline.spec.ts @@ -141,6 +141,21 @@ describe('n-timeline-item', () => { ) }) + it('should work with `line-type` prop', () => { + ;(['default', 'dashed'] as const).forEach((lineType) => { + const wrapper = mount(NTimeline, { + slots: { + default: () => + h(NTimelineItem, { title: 'test-title', lineType: lineType }) + } + }) + + expect(wrapper.find('.n-timeline-item').classes()).toContain( + `n-timeline-item--${lineType}-line-type` + ) + }) + }) + it('should work with `default`, `footer`, `header` slots', async () => { const wrapper = mount(NTimeline, { slots: {