forked from Tencent/tdesign-vue-next
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Timeline] tests & features & bugs (Tencent#2395)
* feat(timeline): tests & bugs & features * refactor(timeline): rename file name * fix(timeline): dot center * fix(dialog): ssr need string to telport * fix(dialog): teleport
- Loading branch information
1 parent
b3f44ef
commit 532e107
Showing
22 changed files
with
485 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
137 changes: 137 additions & 0 deletions
137
src/timeline/__tests__/__snapshots__/vitest-timeline.test.jsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
// Vitest Snapshot v1 | ||
|
||
exports[`TimelineItem Component > props.content works fine 1`] = ` | ||
<li | ||
class="t-timeline-item t-timeline-item-top" | ||
> | ||
<!----> | ||
<div | ||
class="t-timeline-item__wrapper" | ||
> | ||
<div | ||
class="t-timeline-item__dot t-timeline-item__dot--default" | ||
> | ||
<!----> | ||
<!----> | ||
</div> | ||
<div | ||
class="t-timeline-item__tail t-timeline-item__tail--theme-default" | ||
/> | ||
</div> | ||
<div | ||
class="t-timeline-item__content" | ||
> | ||
<span | ||
class="custom-node" | ||
> | ||
TNode | ||
</span> | ||
<!----> | ||
</div> | ||
</li> | ||
`; | ||
|
||
exports[`TimelineItem Component > props.label works fine 1`] = ` | ||
<li | ||
class="t-timeline-item t-timeline-item-top" | ||
> | ||
<div | ||
class="t-timeline-item__label t-timeline-item__label--alternate" | ||
> | ||
<span | ||
class="custom-node" | ||
> | ||
TNode | ||
</span> | ||
</div> | ||
<div | ||
class="t-timeline-item__wrapper" | ||
> | ||
<div | ||
class="t-timeline-item__dot t-timeline-item__dot--default" | ||
> | ||
<!----> | ||
<!----> | ||
</div> | ||
<div | ||
class="t-timeline-item__tail t-timeline-item__tail--theme-default" | ||
/> | ||
</div> | ||
<div | ||
class="t-timeline-item__content" | ||
> | ||
<!----> | ||
<!----> | ||
</div> | ||
</li> | ||
`; | ||
|
||
exports[`TimelineItem Component > slots.content works fine 1`] = ` | ||
<li | ||
class="t-timeline-item t-timeline-item-top" | ||
> | ||
<!----> | ||
<div | ||
class="t-timeline-item__wrapper" | ||
> | ||
<div | ||
class="t-timeline-item__dot t-timeline-item__dot--default" | ||
> | ||
<!----> | ||
<!----> | ||
</div> | ||
<div | ||
class="t-timeline-item__tail t-timeline-item__tail--theme-default" | ||
/> | ||
</div> | ||
<div | ||
class="t-timeline-item__content" | ||
> | ||
<span | ||
class="custom-node" | ||
> | ||
TNode | ||
</span> | ||
<!----> | ||
</div> | ||
</li> | ||
`; | ||
|
||
exports[`TimelineItem Component > slots.label works fine 1`] = ` | ||
<li | ||
class="t-timeline-item t-timeline-item-top" | ||
> | ||
<div | ||
class="t-timeline-item__label t-timeline-item__label--alternate" | ||
> | ||
<span | ||
class="custom-node" | ||
> | ||
TNode | ||
</span> | ||
</div> | ||
<div | ||
class="t-timeline-item__wrapper" | ||
> | ||
<div | ||
class="t-timeline-item__dot t-timeline-item__dot--default" | ||
> | ||
<!----> | ||
<!----> | ||
</div> | ||
<div | ||
class="t-timeline-item__tail t-timeline-item__tail--theme-default" | ||
/> | ||
</div> | ||
<div | ||
class="t-timeline-item__content" | ||
> | ||
<!----> | ||
<!----> | ||
</div> | ||
</li> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { mount } from '@vue/test-utils'; | ||
import { Timeline, TimelineItem } from '../../timeline'; | ||
|
||
export function getTimelineDefaultMount(Timeline, props, events) { | ||
return mount( | ||
<Timeline {...props} {...events}> | ||
<TimelineItem label="2022-01-01">Event1</TimelineItem> | ||
<TimelineItem label="2022-02-01">Event2</TimelineItem> | ||
<TimelineItem label="2022-03-01">Event3</TimelineItem> | ||
<TimelineItem label="2022-04-01" dotColor="yellowgreen"> | ||
Event4 | ||
</TimelineItem> | ||
</Timeline>, | ||
); | ||
} | ||
|
||
// labelAlign 优先级比较 | ||
export function getTimelineItemMount(TimelineItem, props) { | ||
return mount( | ||
<Timeline labelAlign="right"> | ||
<TimelineItem {...props} label="2022-01-01"> | ||
Event1 | ||
</TimelineItem> | ||
<TimelineItem label="2022-02-01">Event2</TimelineItem> | ||
<TimelineItem label="2022-03-01">Event3</TimelineItem> | ||
<TimelineItem label="2022-04-01">Event4</TimelineItem> | ||
</Timeline>, | ||
); | ||
} | ||
|
||
export default getTimelineDefaultMount; |
Oops, something went wrong.