@yh-ui/components 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/breadcrumb/src/breadcrumb-item.vue +10 -6
- package/dist/form/index.cjs +1 -1
- package/dist/form/index.d.ts +1 -1
- package/dist/form/index.mjs +1 -1
- package/dist/icon/index.cjs +1 -1
- package/dist/icon/index.d.ts +1 -1
- package/dist/icon/index.mjs +1 -1
- package/dist/loading/index.cjs +1 -1
- package/dist/loading/index.d.ts +1 -1
- package/dist/loading/index.mjs +1 -1
- package/dist/message/src/method.cjs +1 -1
- package/dist/message/src/method.d.ts +1 -1
- package/dist/message/src/method.mjs +1 -1
- package/dist/message-box/index.cjs +1 -1
- package/dist/message-box/index.d.ts +1 -1
- package/dist/message-box/index.mjs +1 -1
- package/dist/notification/src/method.cjs +1 -1
- package/dist/notification/src/method.d.ts +1 -1
- package/dist/notification/src/method.mjs +1 -1
- package/dist/resolver.cjs +1 -1
- package/dist/resolver.d.ts +7 -5
- package/dist/resolver.mjs +1 -1
- package/dist/style.css +584 -0
- package/package.json +9 -8
- package/dist/affix/__tests__/affix.bottom.test.cjs +0 -101
- package/dist/affix/__tests__/affix.bottom.test.mjs +0 -88
- package/dist/affix/__tests__/affix.ssr.test.cjs +0 -38
- package/dist/affix/__tests__/affix.ssr.test.mjs +0 -51
- package/dist/affix/__tests__/affix.test.cjs +0 -185
- package/dist/affix/__tests__/affix.test.mjs +0 -180
- package/dist/ai-action-group/__tests__/ai-action-group.ssr.test.cjs +0 -55
- package/dist/ai-action-group/__tests__/ai-action-group.ssr.test.mjs +0 -39
- package/dist/ai-action-group/__tests__/ai-action-group.test.cjs +0 -235
- package/dist/ai-action-group/__tests__/ai-action-group.test.mjs +0 -157
- package/dist/ai-agent-card/__tests__/ai-agent-card.ssr.test.cjs +0 -61
- package/dist/ai-agent-card/__tests__/ai-agent-card.ssr.test.mjs +0 -65
- package/dist/ai-agent-card/__tests__/ai-agent-card.test.cjs +0 -205
- package/dist/ai-agent-card/__tests__/ai-agent-card.test.mjs +0 -133
- package/dist/ai-artifacts/__tests__/ai-artifacts.ssr.test.cjs +0 -73
- package/dist/ai-artifacts/__tests__/ai-artifacts.ssr.test.mjs +0 -68
- package/dist/ai-artifacts/__tests__/ai-artifacts.test.cjs +0 -128
- package/dist/ai-artifacts/__tests__/ai-artifacts.test.mjs +0 -109
- package/dist/ai-attachments/__tests__/ai-attachments.ssr.test.cjs +0 -50
- package/dist/ai-attachments/__tests__/ai-attachments.ssr.test.mjs +0 -33
- package/dist/ai-attachments/__tests__/ai-attachments.test.cjs +0 -113
- package/dist/ai-attachments/__tests__/ai-attachments.test.mjs +0 -81
- package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.cjs +0 -95
- package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.mjs +0 -66
- package/dist/ai-bubble/__tests__/ai-bubble.test.cjs +0 -624
- package/dist/ai-bubble/__tests__/ai-bubble.test.mjs +0 -393
- package/dist/ai-bubble-list/__tests__/ai-bubble-list.ssr.test.cjs +0 -51
- package/dist/ai-bubble-list/__tests__/ai-bubble-list.ssr.test.mjs +0 -51
- package/dist/ai-bubble-list/__tests__/ai-bubble-list.test.cjs +0 -138
- package/dist/ai-bubble-list/__tests__/ai-bubble-list.test.mjs +0 -112
- package/dist/ai-chat/__tests__/ai-chat.ssr.test.cjs +0 -90
- package/dist/ai-chat/__tests__/ai-chat.ssr.test.mjs +0 -77
- package/dist/ai-chat/__tests__/ai-chat.test.cjs +0 -177
- package/dist/ai-chat/__tests__/ai-chat.test.mjs +0 -129
- package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.cjs +0 -75
- package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.mjs +0 -57
- package/dist/ai-code-block/__tests__/ai-code-block.test.cjs +0 -174
- package/dist/ai-code-block/__tests__/ai-code-block.test.mjs +0 -108
- package/dist/ai-code-editor/__tests__/ai-code-editor.ssr.test.cjs +0 -46
- package/dist/ai-code-editor/__tests__/ai-code-editor.ssr.test.mjs +0 -39
- package/dist/ai-code-editor/__tests__/ai-code-editor.test.cjs +0 -90
- package/dist/ai-code-editor/__tests__/ai-code-editor.test.mjs +0 -78
- package/dist/ai-code-runner/__tests__/ai-code-runner.ssr.test.cjs +0 -28
- package/dist/ai-code-runner/__tests__/ai-code-runner.ssr.test.mjs +0 -26
- package/dist/ai-code-runner/__tests__/ai-code-runner.test.cjs +0 -69
- package/dist/ai-code-runner/__tests__/ai-code-runner.test.mjs +0 -66
- package/dist/ai-conversations/__tests__/ai-conversations.ssr.test.cjs +0 -50
- package/dist/ai-conversations/__tests__/ai-conversations.ssr.test.mjs +0 -42
- package/dist/ai-conversations/__tests__/ai-conversations.test.cjs +0 -67
- package/dist/ai-conversations/__tests__/ai-conversations.test.mjs +0 -51
- package/dist/ai-editor-sender/__tests__/ai-editor-sender.ssr.test.cjs +0 -62
- package/dist/ai-editor-sender/__tests__/ai-editor-sender.ssr.test.mjs +0 -50
- package/dist/ai-editor-sender/__tests__/ai-editor-sender.test.cjs +0 -315
- package/dist/ai-editor-sender/__tests__/ai-editor-sender.test.mjs +0 -226
- package/dist/ai-file-card/__tests__/ai-file-card.ssr.test.cjs +0 -45
- package/dist/ai-file-card/__tests__/ai-file-card.ssr.test.mjs +0 -29
- package/dist/ai-file-card/__tests__/ai-file-card.test.cjs +0 -160
- package/dist/ai-file-card/__tests__/ai-file-card.test.mjs +0 -109
- package/dist/ai-mention/__tests__/ai-mention.ssr.test.cjs +0 -38
- package/dist/ai-mention/__tests__/ai-mention.ssr.test.mjs +0 -37
- package/dist/ai-mention/__tests__/ai-mention.test.cjs +0 -113
- package/dist/ai-mention/__tests__/ai-mention.test.mjs +0 -84
- package/dist/ai-mermaid/__tests__/ai-mermaid.ssr.test.cjs +0 -43
- package/dist/ai-mermaid/__tests__/ai-mermaid.ssr.test.mjs +0 -33
- package/dist/ai-mermaid/__tests__/ai-mermaid.test.cjs +0 -113
- package/dist/ai-mermaid/__tests__/ai-mermaid.test.mjs +0 -92
- package/dist/ai-prompts/__tests__/ai-prompts.ssr.test.cjs +0 -49
- package/dist/ai-prompts/__tests__/ai-prompts.ssr.test.mjs +0 -41
- package/dist/ai-prompts/__tests__/ai-prompts.test.cjs +0 -54
- package/dist/ai-prompts/__tests__/ai-prompts.test.mjs +0 -38
- package/dist/ai-provider/__tests__/ai-provider.ssr.test.cjs +0 -33
- package/dist/ai-provider/__tests__/ai-provider.ssr.test.mjs +0 -34
- package/dist/ai-provider/__tests__/ai-provider.test.cjs +0 -38
- package/dist/ai-provider/__tests__/ai-provider.test.mjs +0 -33
- package/dist/ai-sender/__tests__/ai-sender.ssr.test.cjs +0 -46
- package/dist/ai-sender/__tests__/ai-sender.ssr.test.mjs +0 -37
- package/dist/ai-sender/__tests__/ai-sender.test.cjs +0 -511
- package/dist/ai-sender/__tests__/ai-sender.test.mjs +0 -322
- package/dist/ai-sources/__tests__/ai-sources.ssr.test.cjs +0 -72
- package/dist/ai-sources/__tests__/ai-sources.ssr.test.mjs +0 -82
- package/dist/ai-sources/__tests__/ai-sources.test.cjs +0 -200
- package/dist/ai-sources/__tests__/ai-sources.test.mjs +0 -160
- package/dist/ai-thinking/__tests__/ai-thinking.ssr.test.cjs +0 -56
- package/dist/ai-thinking/__tests__/ai-thinking.ssr.test.mjs +0 -42
- package/dist/ai-thinking/__tests__/ai-thinking.test.cjs +0 -151
- package/dist/ai-thinking/__tests__/ai-thinking.test.mjs +0 -96
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.cjs +0 -88
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.mjs +0 -55
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.cjs +0 -344
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.mjs +0 -237
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.ssr.test.cjs +0 -32
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.ssr.test.mjs +0 -25
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.cjs +0 -130
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.mjs +0 -103
- package/dist/ai-welcome/__tests__/ai-welcome.ssr.test.cjs +0 -57
- package/dist/ai-welcome/__tests__/ai-welcome.ssr.test.mjs +0 -39
- package/dist/ai-welcome/__tests__/ai-welcome.test.cjs +0 -169
- package/dist/ai-welcome/__tests__/ai-welcome.test.mjs +0 -113
- package/dist/alert/__tests__/alert.ssr.test.cjs +0 -28
- package/dist/alert/__tests__/alert.ssr.test.mjs +0 -29
- package/dist/alert/__tests__/alert.test.cjs +0 -123
- package/dist/alert/__tests__/alert.test.mjs +0 -110
- package/dist/autocomplete/__tests__/autocomplete.ssr.test.cjs +0 -54
- package/dist/autocomplete/__tests__/autocomplete.ssr.test.mjs +0 -47
- package/dist/autocomplete/__tests__/autocomplete.test.cjs +0 -299
- package/dist/autocomplete/__tests__/autocomplete.test.mjs +0 -263
- package/dist/avatar/__tests__/avatar.ssr.test.cjs +0 -103
- package/dist/avatar/__tests__/avatar.ssr.test.mjs +0 -108
- package/dist/avatar/__tests__/avatar.test.cjs +0 -146
- package/dist/avatar/__tests__/avatar.test.mjs +0 -125
- package/dist/back-top/__tests__/back-top.ssr.test.cjs +0 -13
- package/dist/back-top/__tests__/back-top.ssr.test.mjs +0 -10
- package/dist/back-top/__tests__/back-top.test.cjs +0 -88
- package/dist/back-top/__tests__/back-top.test.mjs +0 -76
- package/dist/badge/__tests__/badge.ssr.test.cjs +0 -36
- package/dist/badge/__tests__/badge.ssr.test.mjs +0 -33
- package/dist/badge/__tests__/badge.test.cjs +0 -115
- package/dist/badge/__tests__/badge.test.mjs +0 -112
- package/dist/breadcrumb/__tests__/breadcrumb.ssr.test.cjs +0 -22
- package/dist/breadcrumb/__tests__/breadcrumb.ssr.test.mjs +0 -20
- package/dist/breadcrumb/__tests__/breadcrumb.test.cjs +0 -64
- package/dist/breadcrumb/__tests__/breadcrumb.test.mjs +0 -51
- package/dist/button/__tests__/button.ssr.test.cjs +0 -52
- package/dist/button/__tests__/button.ssr.test.mjs +0 -55
- package/dist/button/__tests__/button.test.cjs +0 -207
- package/dist/button/__tests__/button.test.mjs +0 -141
- package/dist/calendar/__tests__/calendar.ssr.test.cjs +0 -65
- package/dist/calendar/__tests__/calendar.ssr.test.mjs +0 -63
- package/dist/calendar/__tests__/calendar.test.cjs +0 -263
- package/dist/calendar/__tests__/calendar.test.mjs +0 -255
- package/dist/card/__tests__/card.ssr.test.cjs +0 -37
- package/dist/card/__tests__/card.ssr.test.mjs +0 -40
- package/dist/card/__tests__/card.test.cjs +0 -131
- package/dist/card/__tests__/card.test.mjs +0 -124
- package/dist/carousel/__tests__/carousel.ssr.test.cjs +0 -27
- package/dist/carousel/__tests__/carousel.ssr.test.mjs +0 -27
- package/dist/carousel/__tests__/carousel.test.cjs +0 -115
- package/dist/carousel/__tests__/carousel.test.mjs +0 -98
- package/dist/cascader/__tests__/cascader-panel.test.cjs +0 -162
- package/dist/cascader/__tests__/cascader-panel.test.mjs +0 -151
- package/dist/cascader/__tests__/cascader.ssr.test.cjs +0 -61
- package/dist/cascader/__tests__/cascader.ssr.test.mjs +0 -55
- package/dist/cascader/__tests__/cascader.test.cjs +0 -342
- package/dist/cascader/__tests__/cascader.test.mjs +0 -316
- package/dist/category-nav/__tests__/category-nav.ssr.test.cjs +0 -35
- package/dist/category-nav/__tests__/category-nav.ssr.test.mjs +0 -21
- package/dist/category-nav/__tests__/category-nav.test.cjs +0 -53
- package/dist/category-nav/__tests__/category-nav.test.mjs +0 -33
- package/dist/checkbox/__tests__/checkbox.ssr.test.cjs +0 -52
- package/dist/checkbox/__tests__/checkbox.ssr.test.mjs +0 -57
- package/dist/checkbox/__tests__/checkbox.test.cjs +0 -173
- package/dist/checkbox/__tests__/checkbox.test.mjs +0 -133
- package/dist/col/__tests__/col.ssr.test.cjs +0 -44
- package/dist/col/__tests__/col.ssr.test.mjs +0 -42
- package/dist/col/__tests__/col.test.cjs +0 -128
- package/dist/col/__tests__/col.test.mjs +0 -116
- package/dist/color-picker/__tests__/color-picker.ssr.test.cjs +0 -34
- package/dist/color-picker/__tests__/color-picker.ssr.test.mjs +0 -39
- package/dist/color-picker/__tests__/color-picker.test.cjs +0 -227
- package/dist/color-picker/__tests__/color-picker.test.mjs +0 -176
- package/dist/config-provider/__tests__/config-provider.ssr.test.cjs +0 -43
- package/dist/config-provider/__tests__/config-provider.ssr.test.mjs +0 -42
- package/dist/config-provider/__tests__/config-provider.test.cjs +0 -75
- package/dist/config-provider/__tests__/config-provider.test.mjs +0 -64
- package/dist/container/__tests__/container.ssr.test.cjs +0 -71
- package/dist/container/__tests__/container.ssr.test.mjs +0 -50
- package/dist/container/__tests__/container.test.cjs +0 -111
- package/dist/container/__tests__/container.test.mjs +0 -84
- package/dist/countdown/__tests__/countdown.ssr.test.cjs +0 -86
- package/dist/countdown/__tests__/countdown.ssr.test.mjs +0 -78
- package/dist/countdown/__tests__/countdown.test.cjs +0 -767
- package/dist/countdown/__tests__/countdown.test.mjs +0 -722
- package/dist/coupon-card/__tests__/coupon-card.ssr.test.cjs +0 -21
- package/dist/coupon-card/__tests__/coupon-card.ssr.test.mjs +0 -18
- package/dist/coupon-card/__tests__/coupon-card.test.cjs +0 -67
- package/dist/coupon-card/__tests__/coupon-card.test.mjs +0 -64
- package/dist/date-picker/__tests__/date-picker-extended.test.cjs +0 -581
- package/dist/date-picker/__tests__/date-picker-extended.test.mjs +0 -455
- package/dist/date-picker/__tests__/date-picker.ssr.test.cjs +0 -26
- package/dist/date-picker/__tests__/date-picker.ssr.test.mjs +0 -23
- package/dist/date-picker/__tests__/date-picker.test.cjs +0 -170
- package/dist/date-picker/__tests__/date-picker.test.mjs +0 -136
- package/dist/descriptions/__tests__/descriptions.ssr.test.cjs +0 -67
- package/dist/descriptions/__tests__/descriptions.ssr.test.mjs +0 -72
- package/dist/descriptions/__tests__/descriptions.test.cjs +0 -150
- package/dist/descriptions/__tests__/descriptions.test.mjs +0 -130
- package/dist/dialog/__tests__/dialog.functional.test.cjs +0 -49
- package/dist/dialog/__tests__/dialog.functional.test.mjs +0 -49
- package/dist/dialog/__tests__/dialog.ssr.test.cjs +0 -31
- package/dist/dialog/__tests__/dialog.ssr.test.mjs +0 -29
- package/dist/dialog/__tests__/dialog.test.cjs +0 -561
- package/dist/dialog/__tests__/dialog.test.mjs +0 -388
- package/dist/divider/__tests__/divider.ssr.test.cjs +0 -41
- package/dist/divider/__tests__/divider.ssr.test.mjs +0 -44
- package/dist/divider/__tests__/divider.test.cjs +0 -71
- package/dist/divider/__tests__/divider.test.mjs +0 -68
- package/dist/drawer/__tests__/drawer.ssr.test.cjs +0 -25
- package/dist/drawer/__tests__/drawer.ssr.test.mjs +0 -23
- package/dist/drawer/__tests__/drawer.test.cjs +0 -145
- package/dist/drawer/__tests__/drawer.test.mjs +0 -122
- package/dist/dropdown/__tests__/dropdown.ssr.test.cjs +0 -49
- package/dist/dropdown/__tests__/dropdown.ssr.test.mjs +0 -64
- package/dist/dropdown/__tests__/dropdown.test.cjs +0 -310
- package/dist/dropdown/__tests__/dropdown.test.mjs +0 -269
- package/dist/empty/__tests__/empty.ssr.test.cjs +0 -96
- package/dist/empty/__tests__/empty.ssr.test.mjs +0 -99
- package/dist/empty/__tests__/empty.test.cjs +0 -110
- package/dist/empty/__tests__/empty.test.mjs +0 -101
- package/dist/filter-bar/__tests__/filter-bar.ssr.test.cjs +0 -29
- package/dist/filter-bar/__tests__/filter-bar.ssr.test.mjs +0 -16
- package/dist/filter-bar/__tests__/filter-bar.test.cjs +0 -51
- package/dist/filter-bar/__tests__/filter-bar.test.mjs +0 -29
- package/dist/form/__tests__/form-schema.test.cjs +0 -636
- package/dist/form/__tests__/form-schema.test.mjs +0 -366
- package/dist/form/__tests__/form.ssr.test.cjs +0 -74
- package/dist/form/__tests__/form.ssr.test.mjs +0 -73
- package/dist/form/__tests__/form.test.cjs +0 -208
- package/dist/form/__tests__/form.test.mjs +0 -128
- package/dist/gantt-chart/__tests__/debug_ssr.test.cjs +0 -51
- package/dist/gantt-chart/__tests__/debug_ssr.test.mjs +0 -37
- package/dist/gantt-chart/__tests__/gantt-chart.ssr.test.cjs +0 -95
- package/dist/gantt-chart/__tests__/gantt-chart.ssr.test.mjs +0 -94
- package/dist/gantt-chart/__tests__/gantt-chart.test.cjs +0 -86
- package/dist/gantt-chart/__tests__/gantt-chart.test.mjs +0 -79
- package/dist/grid/__tests__/grid.ssr.test.cjs +0 -81
- package/dist/grid/__tests__/grid.ssr.test.mjs +0 -63
- package/dist/grid/__tests__/grid.test.cjs +0 -142
- package/dist/grid/__tests__/grid.test.mjs +0 -89
- package/dist/icon/__tests__/icon.ssr.test.cjs +0 -35
- package/dist/icon/__tests__/icon.ssr.test.mjs +0 -26
- package/dist/icon/__tests__/icon.test.cjs +0 -144
- package/dist/icon/__tests__/icon.test.mjs +0 -123
- package/dist/image/__tests__/image-viewer.test.cjs +0 -101
- package/dist/image/__tests__/image-viewer.test.mjs +0 -94
- package/dist/image/__tests__/image.ssr.test.cjs +0 -73
- package/dist/image/__tests__/image.ssr.test.mjs +0 -72
- package/dist/image/__tests__/image.test.cjs +0 -171
- package/dist/image/__tests__/image.test.mjs +0 -159
- package/dist/image-magnifier/__tests__/image-magnifier.ssr.test.cjs +0 -54
- package/dist/image-magnifier/__tests__/image-magnifier.ssr.test.mjs +0 -35
- package/dist/image-magnifier/__tests__/image-magnifier.test.cjs +0 -257
- package/dist/image-magnifier/__tests__/image-magnifier.test.mjs +0 -177
- package/dist/infinite-scroll/__tests__/infinite-scroll.ssr.test.cjs +0 -59
- package/dist/infinite-scroll/__tests__/infinite-scroll.ssr.test.mjs +0 -84
- package/dist/infinite-scroll/__tests__/infinite-scroll.test.cjs +0 -255
- package/dist/infinite-scroll/__tests__/infinite-scroll.test.mjs +0 -187
- package/dist/input/__tests__/input-utils.test.cjs +0 -77
- package/dist/input/__tests__/input-utils.test.mjs +0 -75
- package/dist/input/__tests__/input.ssr.test.cjs +0 -100
- package/dist/input/__tests__/input.ssr.test.mjs +0 -85
- package/dist/input/__tests__/input.test.cjs +0 -127
- package/dist/input/__tests__/input.test.mjs +0 -112
- package/dist/input-number/__tests__/input-number.hydration.test.cjs +0 -24
- package/dist/input-number/__tests__/input-number.hydration.test.mjs +0 -21
- package/dist/input-number/__tests__/input-number.ssr.test.cjs +0 -95
- package/dist/input-number/__tests__/input-number.ssr.test.mjs +0 -92
- package/dist/input-number/__tests__/input-number.test.cjs +0 -199
- package/dist/input-number/__tests__/input-number.test.mjs +0 -173
- package/dist/input-tag/__tests__/input-tag.ssr.test.cjs +0 -47
- package/dist/input-tag/__tests__/input-tag.ssr.test.mjs +0 -41
- package/dist/input-tag/__tests__/input-tag.test.cjs +0 -268
- package/dist/input-tag/__tests__/input-tag.test.mjs +0 -201
- package/dist/loading/__tests__/loading.ssr.test.cjs +0 -37
- package/dist/loading/__tests__/loading.ssr.test.mjs +0 -27
- package/dist/loading/__tests__/loading.test.cjs +0 -91
- package/dist/loading/__tests__/loading.test.mjs +0 -75
- package/dist/lucky-draw/__tests__/lucky-draw.ssr.test.cjs +0 -33
- package/dist/lucky-draw/__tests__/lucky-draw.ssr.test.mjs +0 -31
- package/dist/lucky-draw/__tests__/lucky-draw.test.cjs +0 -56
- package/dist/lucky-draw/__tests__/lucky-draw.test.mjs +0 -48
- package/dist/marquee/__tests__/marquee.ssr.test.cjs +0 -59
- package/dist/marquee/__tests__/marquee.ssr.test.mjs +0 -60
- package/dist/marquee/__tests__/marquee.test.cjs +0 -94
- package/dist/marquee/__tests__/marquee.test.mjs +0 -92
- package/dist/mention/__tests__/mention.ssr.test.cjs +0 -92
- package/dist/mention/__tests__/mention.ssr.test.mjs +0 -70
- package/dist/mention/__tests__/mention.test.cjs +0 -650
- package/dist/mention/__tests__/mention.test.mjs +0 -523
- package/dist/menu/__tests__/menu.ssr.test.cjs +0 -92
- package/dist/menu/__tests__/menu.ssr.test.mjs +0 -124
- package/dist/menu/__tests__/menu.test.cjs +0 -209
- package/dist/menu/__tests__/menu.test.mjs +0 -182
- package/dist/message/__tests__/message.ssr.test.cjs +0 -29
- package/dist/message/__tests__/message.ssr.test.mjs +0 -23
- package/dist/message/__tests__/message.test.cjs +0 -170
- package/dist/message/__tests__/message.test.mjs +0 -154
- package/dist/message-box/__tests__/message-box.ssr.test.cjs +0 -33
- package/dist/message-box/__tests__/message-box.ssr.test.mjs +0 -30
- package/dist/message-box/__tests__/message-box.test.cjs +0 -100
- package/dist/message-box/__tests__/message-box.test.mjs +0 -95
- package/dist/notification/__tests__/notification.ssr.test.cjs +0 -31
- package/dist/notification/__tests__/notification.ssr.test.mjs +0 -25
- package/dist/notification/__tests__/notification.test.cjs +0 -248
- package/dist/notification/__tests__/notification.test.mjs +0 -206
- package/dist/pagination/__tests__/pagination.ssr.test.cjs +0 -61
- package/dist/pagination/__tests__/pagination.ssr.test.mjs +0 -59
- package/dist/pagination/__tests__/pagination.test.cjs +0 -135
- package/dist/pagination/__tests__/pagination.test.mjs +0 -131
- package/dist/popconfirm/__tests__/popconfirm.ssr.test.cjs +0 -48
- package/dist/popconfirm/__tests__/popconfirm.ssr.test.mjs +0 -63
- package/dist/popconfirm/__tests__/popconfirm.test.cjs +0 -62
- package/dist/popconfirm/__tests__/popconfirm.test.mjs +0 -56
- package/dist/popover/__tests__/popover.ssr.test.cjs +0 -48
- package/dist/popover/__tests__/popover.ssr.test.mjs +0 -63
- package/dist/popover/__tests__/popover.test.cjs +0 -107
- package/dist/popover/__tests__/popover.test.mjs +0 -93
- package/dist/price/__tests__/price.ssr.test.cjs +0 -20
- package/dist/price/__tests__/price.ssr.test.mjs +0 -19
- package/dist/price/__tests__/price.test.cjs +0 -45
- package/dist/price/__tests__/price.test.mjs +0 -42
- package/dist/product-card/__tests__/product-card.ssr.test.cjs +0 -21
- package/dist/product-card/__tests__/product-card.ssr.test.mjs +0 -18
- package/dist/product-card/__tests__/product-card.test.cjs +0 -54
- package/dist/product-card/__tests__/product-card.test.mjs +0 -53
- package/dist/progress/__tests__/progress.ssr.test.cjs +0 -31
- package/dist/progress/__tests__/progress.ssr.test.mjs +0 -29
- package/dist/progress/__tests__/progress.test.cjs +0 -119
- package/dist/progress/__tests__/progress.test.mjs +0 -77
- package/dist/radio/__tests__/radio-button.test.cjs +0 -99
- package/dist/radio/__tests__/radio-button.test.mjs +0 -83
- package/dist/radio/__tests__/radio.ssr.test.cjs +0 -132
- package/dist/radio/__tests__/radio.ssr.test.mjs +0 -165
- package/dist/radio/__tests__/radio.test.cjs +0 -170
- package/dist/radio/__tests__/radio.test.mjs +0 -143
- package/dist/rate/__tests__/rate.ssr.test.cjs +0 -106
- package/dist/rate/__tests__/rate.ssr.test.mjs +0 -103
- package/dist/rate/__tests__/rate.test.cjs +0 -88
- package/dist/rate/__tests__/rate.test.mjs +0 -85
- package/dist/result/__tests__/result.ssr.test.cjs +0 -62
- package/dist/result/__tests__/result.ssr.test.mjs +0 -51
- package/dist/result/__tests__/result.test.cjs +0 -135
- package/dist/result/__tests__/result.test.mjs +0 -92
- package/dist/row/__tests__/row.ssr.test.cjs +0 -29
- package/dist/row/__tests__/row.ssr.test.mjs +0 -30
- package/dist/row/__tests__/row.test.cjs +0 -89
- package/dist/row/__tests__/row.test.mjs +0 -86
- package/dist/row/__tests__/row_ts.test.cjs +0 -31
- package/dist/row/__tests__/row_ts.test.mjs +0 -28
- package/dist/scrollbar/__tests__/scrollbar.ssr.test.cjs +0 -49
- package/dist/scrollbar/__tests__/scrollbar.ssr.test.mjs +0 -54
- package/dist/scrollbar/__tests__/scrollbar.test.cjs +0 -43
- package/dist/scrollbar/__tests__/scrollbar.test.mjs +0 -40
- package/dist/select/__tests__/select.perf.test.cjs +0 -191
- package/dist/select/__tests__/select.perf.test.mjs +0 -185
- package/dist/select/__tests__/select.ssr.test.cjs +0 -58
- package/dist/select/__tests__/select.ssr.test.mjs +0 -52
- package/dist/select/__tests__/select.test.cjs +0 -414
- package/dist/select/__tests__/select.test.mjs +0 -345
- package/dist/skeleton/__tests__/skeleton.ssr.test.cjs +0 -81
- package/dist/skeleton/__tests__/skeleton.ssr.test.mjs +0 -83
- package/dist/skeleton/__tests__/skeleton.test.cjs +0 -72
- package/dist/skeleton/__tests__/skeleton.test.mjs +0 -65
- package/dist/sku-selector/__tests__/sku-selector.ssr.test.cjs +0 -32
- package/dist/sku-selector/__tests__/sku-selector.ssr.test.mjs +0 -19
- package/dist/sku-selector/__tests__/sku-selector.test.cjs +0 -64
- package/dist/sku-selector/__tests__/sku-selector.test.mjs +0 -53
- package/dist/slider/__tests__/repro.test.cjs +0 -25
- package/dist/slider/__tests__/repro.test.mjs +0 -22
- package/dist/slider/__tests__/slider.ssr.test.cjs +0 -118
- package/dist/slider/__tests__/slider.ssr.test.mjs +0 -115
- package/dist/slider/__tests__/slider.test.cjs +0 -155
- package/dist/slider/__tests__/slider.test.mjs +0 -120
- package/dist/smart-address/__tests__/smart-address.ssr.test.cjs +0 -28
- package/dist/smart-address/__tests__/smart-address.ssr.test.mjs +0 -25
- package/dist/smart-address/__tests__/smart-address.test.cjs +0 -68
- package/dist/smart-address/__tests__/smart-address.test.mjs +0 -56
- package/dist/space/__tests__/space.ssr.test.cjs +0 -115
- package/dist/space/__tests__/space.ssr.test.mjs +0 -150
- package/dist/space/__tests__/space.test.cjs +0 -227
- package/dist/space/__tests__/space.test.mjs +0 -187
- package/dist/spin/__tests__/spin.ssr.test.cjs +0 -46
- package/dist/spin/__tests__/spin.ssr.test.mjs +0 -43
- package/dist/spin/__tests__/spin.test.cjs +0 -65
- package/dist/spin/__tests__/spin.test.mjs +0 -63
- package/dist/steps/__tests__/steps.ssr.test.cjs +0 -73
- package/dist/steps/__tests__/steps.ssr.test.mjs +0 -55
- package/dist/steps/__tests__/steps.test.cjs +0 -152
- package/dist/steps/__tests__/steps.test.mjs +0 -123
- package/dist/submit-bar/__tests__/submit-bar.ssr.test.cjs +0 -21
- package/dist/submit-bar/__tests__/submit-bar.ssr.test.mjs +0 -18
- package/dist/submit-bar/__tests__/submit-bar.test.cjs +0 -50
- package/dist/submit-bar/__tests__/submit-bar.test.mjs +0 -36
- package/dist/switch/__tests__/switch.ssr.test.cjs +0 -105
- package/dist/switch/__tests__/switch.ssr.test.mjs +0 -102
- package/dist/switch/__tests__/switch.test.cjs +0 -251
- package/dist/switch/__tests__/switch.test.mjs +0 -193
- package/dist/table/__tests__/table-advance.test.cjs +0 -180
- package/dist/table/__tests__/table-advance.test.mjs +0 -118
- package/dist/table/__tests__/table-interaction.test.cjs +0 -236
- package/dist/table/__tests__/table-interaction.test.mjs +0 -162
- package/dist/table/__tests__/table-utils.test.cjs +0 -690
- package/dist/table/__tests__/table-utils.test.mjs +0 -485
- package/dist/table/__tests__/table.perf.test.cjs +0 -231
- package/dist/table/__tests__/table.perf.test.mjs +0 -225
- package/dist/table/__tests__/table.ssr.test.cjs +0 -296
- package/dist/table/__tests__/table.ssr.test.mjs +0 -265
- package/dist/table/__tests__/table.test.cjs +0 -682
- package/dist/table/__tests__/table.test.mjs +0 -617
- package/dist/table/__tests__/use-column-drag.test.cjs +0 -238
- package/dist/table/__tests__/use-column-drag.test.mjs +0 -150
- package/dist/table/__tests__/use-table-export.test.cjs +0 -179
- package/dist/table/__tests__/use-table-export.test.mjs +0 -105
- package/dist/table/__tests__/use-table-import.test.cjs +0 -206
- package/dist/table/__tests__/use-table-import.test.mjs +0 -144
- package/dist/table/__tests__/use-table-print.test.cjs +0 -190
- package/dist/table/__tests__/use-table-print.test.mjs +0 -134
- package/dist/table/__tests__/use-virtual-scroll.test.cjs +0 -286
- package/dist/table/__tests__/use-virtual-scroll.test.mjs +0 -196
- package/dist/tabs/__tests__/tabs.ssr.test.cjs +0 -57
- package/dist/tabs/__tests__/tabs.ssr.test.mjs +0 -41
- package/dist/tabs/__tests__/tabs.test.cjs +0 -171
- package/dist/tabs/__tests__/tabs.test.mjs +0 -134
- package/dist/tag/__tests__/tag.ssr.test.cjs +0 -45
- package/dist/tag/__tests__/tag.ssr.test.mjs +0 -48
- package/dist/tag/__tests__/tag.test.cjs +0 -194
- package/dist/tag/__tests__/tag.test.mjs +0 -167
- package/dist/time-picker/__tests__/time-picker.ssr.test.cjs +0 -46
- package/dist/time-picker/__tests__/time-picker.ssr.test.mjs +0 -43
- package/dist/time-picker/__tests__/time-picker.test.cjs +0 -228
- package/dist/time-picker/__tests__/time-picker.test.mjs +0 -218
- package/dist/time-picker/__tests__/time-spinner.test.cjs +0 -196
- package/dist/time-picker/__tests__/time-spinner.test.mjs +0 -162
- package/dist/time-select/__tests__/time-select.ssr.test.cjs +0 -42
- package/dist/time-select/__tests__/time-select.ssr.test.mjs +0 -37
- package/dist/time-select/__tests__/time-select.test.cjs +0 -390
- package/dist/time-select/__tests__/time-select.test.mjs +0 -374
- package/dist/tooltip/__tests__/tooltip.ssr.test.cjs +0 -55
- package/dist/tooltip/__tests__/tooltip.ssr.test.mjs +0 -76
- package/dist/tooltip/__tests__/tooltip.test.cjs +0 -132
- package/dist/tooltip/__tests__/tooltip.test.mjs +0 -121
- package/dist/transfer/__tests__/transfer.ssr.test.cjs +0 -47
- package/dist/transfer/__tests__/transfer.ssr.test.mjs +0 -44
- package/dist/transfer/__tests__/transfer.test.cjs +0 -422
- package/dist/transfer/__tests__/transfer.test.mjs +0 -405
- package/dist/tree/__tests__/tree.perf.test.cjs +0 -182
- package/dist/tree/__tests__/tree.perf.test.mjs +0 -198
- package/dist/tree/__tests__/tree.ssr.test.cjs +0 -56
- package/dist/tree/__tests__/tree.ssr.test.mjs +0 -45
- package/dist/tree/__tests__/tree.test.cjs +0 -488
- package/dist/tree/__tests__/tree.test.mjs +0 -333
- package/dist/tree-select/__tests__/tree-select.ssr.test.cjs +0 -52
- package/dist/tree-select/__tests__/tree-select.ssr.test.mjs +0 -55
- package/dist/tree-select/__tests__/tree-select.test.cjs +0 -231
- package/dist/tree-select/__tests__/tree-select.test.mjs +0 -189
- package/dist/typography/__tests__/typography.ssr.test.cjs +0 -85
- package/dist/typography/__tests__/typography.ssr.test.mjs +0 -63
- package/dist/typography/__tests__/typography.test.cjs +0 -362
- package/dist/typography/__tests__/typography.test.mjs +0 -161
- package/dist/upload/__tests__/upload.ssr.test.cjs +0 -28
- package/dist/upload/__tests__/upload.ssr.test.mjs +0 -26
- package/dist/upload/__tests__/upload.test.cjs +0 -467
- package/dist/upload/__tests__/upload.test.mjs +0 -336
- package/dist/waterfall/__tests__/waterfall.ssr.test.cjs +0 -38
- package/dist/waterfall/__tests__/waterfall.ssr.test.mjs +0 -39
- package/dist/waterfall/__tests__/waterfall.test.cjs +0 -122
- package/dist/waterfall/__tests__/waterfall.test.mjs +0 -85
- package/dist/watermark/__tests__/watermark.ssr.test.cjs +0 -32
- package/dist/watermark/__tests__/watermark.ssr.test.mjs +0 -30
- package/dist/watermark/__tests__/watermark.test.cjs +0 -127
- package/dist/watermark/__tests__/watermark.test.mjs +0 -124
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { mount } from "@vue/test-utils";
|
|
2
|
-
import { describe, it, expect, vi } from "vitest";
|
|
3
|
-
import { nextTick } from "vue";
|
|
4
|
-
import YhTreeSelect from "../src/tree-select.vue";
|
|
5
|
-
describe("YhTreeSelect", () => {
|
|
6
|
-
const data = [
|
|
7
|
-
{
|
|
8
|
-
id: "1",
|
|
9
|
-
name: "\u516C\u53F8\u603B\u90E8",
|
|
10
|
-
items: [
|
|
11
|
-
{
|
|
12
|
-
id: "1-1",
|
|
13
|
-
name: "\u7814\u53D1\u4E2D\u5FC3",
|
|
14
|
-
items: [
|
|
15
|
-
{ id: "1-1-1", name: "\u524D\u7AEF\u7EC4" },
|
|
16
|
-
{ id: "1-1-2", name: "\u540E\u7AEF\u7EC4" }
|
|
17
|
-
]
|
|
18
|
-
},
|
|
19
|
-
{ id: "1-2", name: "\u4EA7\u54C1\u90E8" }
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
id: "2",
|
|
24
|
-
name: "\u5206\u516C\u53F8",
|
|
25
|
-
items: [{ id: "2-1", name: "\u5E02\u573A\u90E8" }]
|
|
26
|
-
}
|
|
27
|
-
];
|
|
28
|
-
const propsAlias = { label: "name", value: "id", children: "items" };
|
|
29
|
-
it("renders correctly and supports custom props alias", async () => {
|
|
30
|
-
const wrapper = mount(YhTreeSelect, {
|
|
31
|
-
props: {
|
|
32
|
-
data,
|
|
33
|
-
props: propsAlias,
|
|
34
|
-
nodeKey: "id",
|
|
35
|
-
modelValue: "1-1",
|
|
36
|
-
teleported: false
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
await nextTick();
|
|
40
|
-
expect(wrapper.find(".yh-tree-select__selected-label").text()).toBe("\u7814\u53D1\u4E2D\u5FC3");
|
|
41
|
-
});
|
|
42
|
-
it("emits visible-change event when opened/closed", async () => {
|
|
43
|
-
const wrapper = mount(YhTreeSelect, {
|
|
44
|
-
props: { data, props: propsAlias, teleported: false }
|
|
45
|
-
});
|
|
46
|
-
const trigger = wrapper.find(".yh-tree-select__trigger");
|
|
47
|
-
await trigger.trigger("click");
|
|
48
|
-
expect(wrapper.emitted("visible-change")?.[0]).toEqual([true]);
|
|
49
|
-
await trigger.trigger("click");
|
|
50
|
-
expect(wrapper.emitted("visible-change")?.[1]).toEqual([false]);
|
|
51
|
-
});
|
|
52
|
-
it("emits node-click event with correct arguments", async () => {
|
|
53
|
-
const wrapper = mount(YhTreeSelect, {
|
|
54
|
-
props: { data, props: propsAlias, nodeKey: "id", teleported: false }
|
|
55
|
-
});
|
|
56
|
-
await wrapper.find(".yh-tree-select__trigger").trigger("click");
|
|
57
|
-
const node = wrapper.find(".yh-tree-select__node");
|
|
58
|
-
await node.trigger("click");
|
|
59
|
-
const nodeClickEvent = wrapper.emitted("node-click")?.[0];
|
|
60
|
-
expect(nodeClickEvent?.[0]).toMatchObject({ id: "1", name: "\u516C\u53F8\u603B\u90E8" });
|
|
61
|
-
expect(nodeClickEvent?.[1]).toHaveProperty("key", "1");
|
|
62
|
-
expect(nodeClickEvent?.[2]).toBeDefined();
|
|
63
|
-
});
|
|
64
|
-
it("supports multiple selection events: check and check-change", async () => {
|
|
65
|
-
const wrapper = mount(YhTreeSelect, {
|
|
66
|
-
props: {
|
|
67
|
-
data,
|
|
68
|
-
props: propsAlias,
|
|
69
|
-
multiple: true,
|
|
70
|
-
showCheckbox: true,
|
|
71
|
-
teleported: false,
|
|
72
|
-
nodeKey: "id",
|
|
73
|
-
defaultExpandAll: true
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
await wrapper.find(".yh-tree-select__trigger").trigger("click");
|
|
77
|
-
const nodes = wrapper.findAll(".yh-tree-select__node");
|
|
78
|
-
await nodes[0].trigger("click");
|
|
79
|
-
expect(wrapper.emitted("check-change")).toBeDefined();
|
|
80
|
-
const checkEvent = wrapper.emitted("check")?.[0];
|
|
81
|
-
expect(checkEvent?.[0]).toMatchObject({ id: "1" });
|
|
82
|
-
expect((checkEvent?.[1]).checkedKeys).toContain("1");
|
|
83
|
-
expect((checkEvent?.[1]).checkedKeys).toContain("1-1-1");
|
|
84
|
-
});
|
|
85
|
-
it("respects disabled property of specific nodes", async () => {
|
|
86
|
-
const disabledData = [
|
|
87
|
-
{ id: "1", name: "Enabled" },
|
|
88
|
-
{ id: "2", name: "Disabled", disabled: true }
|
|
89
|
-
];
|
|
90
|
-
const wrapper = mount(YhTreeSelect, {
|
|
91
|
-
props: {
|
|
92
|
-
data: disabledData,
|
|
93
|
-
props: propsAlias,
|
|
94
|
-
nodeKey: "id",
|
|
95
|
-
teleported: false
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
await wrapper.find(".yh-tree-select__trigger").trigger("click");
|
|
99
|
-
const nodes = wrapper.findAll(".yh-tree-select__node");
|
|
100
|
-
expect(nodes[1].classes()).toContain("is-disabled");
|
|
101
|
-
await nodes[1].trigger("click");
|
|
102
|
-
expect(wrapper.emitted("update:modelValue")).toBeUndefined();
|
|
103
|
-
});
|
|
104
|
-
it("filters nodes and shows correct subtree inheritance", async () => {
|
|
105
|
-
const wrapper = mount(YhTreeSelect, {
|
|
106
|
-
props: {
|
|
107
|
-
data,
|
|
108
|
-
props: propsAlias,
|
|
109
|
-
nodeKey: "id",
|
|
110
|
-
filterable: true,
|
|
111
|
-
teleported: false
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
await wrapper.find(".yh-tree-select__trigger").trigger("click");
|
|
115
|
-
const input = wrapper.find("input");
|
|
116
|
-
await input.setValue("\u7814\u53D1");
|
|
117
|
-
await input.trigger("input");
|
|
118
|
-
await nextTick();
|
|
119
|
-
await nextTick();
|
|
120
|
-
const nodes = wrapper.findAll(".yh-tree-select__node");
|
|
121
|
-
const texts = nodes.map((n) => n.text().trim());
|
|
122
|
-
expect(texts).toContain("\u7814\u53D1\u4E2D\u5FC3");
|
|
123
|
-
expect(texts).toContain("\u524D\u7AEF\u7EC4");
|
|
124
|
-
expect(texts).toContain("\u540E\u7AEF\u7EC4");
|
|
125
|
-
expect(texts).not.toContain("\u4EA7\u54C1\u90E8");
|
|
126
|
-
});
|
|
127
|
-
it("syncs state when modelValue is updated externally", async () => {
|
|
128
|
-
const wrapper = mount(YhTreeSelect, {
|
|
129
|
-
props: {
|
|
130
|
-
data,
|
|
131
|
-
props: propsAlias,
|
|
132
|
-
modelValue: "1",
|
|
133
|
-
teleported: false,
|
|
134
|
-
nodeKey: "id"
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
await nextTick();
|
|
138
|
-
expect(wrapper.find(".yh-tree-select__selected-label").text()).toBe("\u516C\u53F8\u603B\u90E8");
|
|
139
|
-
await wrapper.setProps({ modelValue: "2" });
|
|
140
|
-
await nextTick();
|
|
141
|
-
expect(wrapper.find(".yh-tree-select__selected-label").text()).toBe("\u5206\u516C\u53F8");
|
|
142
|
-
});
|
|
143
|
-
it("supports collapse-tags", async () => {
|
|
144
|
-
const wrapper = mount(YhTreeSelect, {
|
|
145
|
-
props: {
|
|
146
|
-
data,
|
|
147
|
-
props: propsAlias,
|
|
148
|
-
multiple: true,
|
|
149
|
-
collapseTags: true,
|
|
150
|
-
modelValue: ["1", "2", "1-1"],
|
|
151
|
-
teleported: false,
|
|
152
|
-
nodeKey: "id"
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
await nextTick();
|
|
156
|
-
const tags = wrapper.findAll(".yh-tree-select__tag");
|
|
157
|
-
expect(tags.length).toBe(2);
|
|
158
|
-
expect(tags[1].text()).toContain("+ 2");
|
|
159
|
-
});
|
|
160
|
-
it("shows empty-text when no matching data found", async () => {
|
|
161
|
-
const wrapper = mount(YhTreeSelect, {
|
|
162
|
-
props: { data: [], emptyText: "\u6CA1\u6709\u6570\u636E\u54E6", teleported: false }
|
|
163
|
-
});
|
|
164
|
-
await wrapper.find(".yh-tree-select__trigger").trigger("click");
|
|
165
|
-
expect(wrapper.find(".yh-tree-select__empty").text()).toBe("\u6CA1\u6709\u6570\u636E\u54E6");
|
|
166
|
-
});
|
|
167
|
-
it("lazy loading works correctly and auto-expands", async () => {
|
|
168
|
-
const load = vi.fn((node, resolve) => {
|
|
169
|
-
resolve([{ id: "lazy-1", name: "Lazy child", isLeaf: true }]);
|
|
170
|
-
});
|
|
171
|
-
const wrapper = mount(YhTreeSelect, {
|
|
172
|
-
props: {
|
|
173
|
-
data: [{ id: "1", name: "Root", items: [] }],
|
|
174
|
-
props: propsAlias,
|
|
175
|
-
lazy: true,
|
|
176
|
-
load,
|
|
177
|
-
teleported: false,
|
|
178
|
-
nodeKey: "id"
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
await wrapper.find(".yh-tree-select__trigger").trigger("click");
|
|
182
|
-
await wrapper.find(".yh-tree-select__node").trigger("click");
|
|
183
|
-
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
184
|
-
await nextTick();
|
|
185
|
-
expect(load).toHaveBeenCalled();
|
|
186
|
-
const allNodes = wrapper.findAll(".yh-tree-select__node");
|
|
187
|
-
expect(allNodes.some((n) => n.text().includes("Lazy child"))).toBe(true);
|
|
188
|
-
});
|
|
189
|
-
});
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _vitest = require("vitest");
|
|
4
|
-
var _title = _interopRequireDefault(require("../src/title.vue"));
|
|
5
|
-
var _text = _interopRequireDefault(require("../src/text.vue"));
|
|
6
|
-
var _paragraph = _interopRequireDefault(require("../src/paragraph.vue"));
|
|
7
|
-
var _link = _interopRequireDefault(require("../src/link.vue"));
|
|
8
|
-
var _ssr = require("../../__tests__/utils/ssr.cjs");
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
(0, _vitest.describe)("YhTypography SSR", () => {
|
|
11
|
-
(0, _vitest.it)("Title should render h2 in SSR", async () => {
|
|
12
|
-
const html = await (0, _ssr.renderSSR)(_title.default, {
|
|
13
|
-
level: 2
|
|
14
|
-
}, {
|
|
15
|
-
default: () => "SSR Title"
|
|
16
|
-
});
|
|
17
|
-
(0, _vitest.expect)(html).toContain("<h2");
|
|
18
|
-
(0, _vitest.expect)(html).toContain("SSR Title");
|
|
19
|
-
(0, _ssr.expectSSRHasClass)(html, "yh-typography__title");
|
|
20
|
-
});
|
|
21
|
-
(0, _vitest.it)("Text should render span in SSR", async () => {
|
|
22
|
-
const html = await (0, _ssr.renderSSR)(_text.default, {
|
|
23
|
-
type: "success"
|
|
24
|
-
}, {
|
|
25
|
-
default: () => "SSR Text"
|
|
26
|
-
});
|
|
27
|
-
(0, _vitest.expect)(html).toContain("SSR Text");
|
|
28
|
-
(0, _ssr.expectSSRHasClass)(html, "yh-typography__text--success");
|
|
29
|
-
});
|
|
30
|
-
(0, _vitest.it)("Paragraph should render p in SSR", async () => {
|
|
31
|
-
const html = await (0, _ssr.renderSSR)(_paragraph.default, {
|
|
32
|
-
align: "center"
|
|
33
|
-
}, {
|
|
34
|
-
default: () => "SSR Paragraph"
|
|
35
|
-
});
|
|
36
|
-
(0, _vitest.expect)(html).toContain("<p");
|
|
37
|
-
(0, _vitest.expect)(html).toContain("SSR Paragraph");
|
|
38
|
-
(0, _ssr.expectSSRHasClass)(html, "yh-typography__paragraph--center");
|
|
39
|
-
});
|
|
40
|
-
(0, _vitest.it)("Link should render a in SSR", async () => {
|
|
41
|
-
const html = await (0, _ssr.renderSSR)(_link.default, {
|
|
42
|
-
href: "https://example.com",
|
|
43
|
-
target: "_blank"
|
|
44
|
-
}, {
|
|
45
|
-
default: () => "Link"
|
|
46
|
-
});
|
|
47
|
-
(0, _vitest.expect)(html).toContain("<a");
|
|
48
|
-
(0, _vitest.expect)(html).toContain('href="https://example.com"');
|
|
49
|
-
(0, _vitest.expect)(html).toContain('target="_blank"');
|
|
50
|
-
});
|
|
51
|
-
(0, _vitest.it)("Title should hydrate without mismatch", async () => {
|
|
52
|
-
const result = await (0, _ssr.testHydration)(_title.default, {
|
|
53
|
-
level: 3
|
|
54
|
-
}, {
|
|
55
|
-
default: () => "Hydrate Title"
|
|
56
|
-
});
|
|
57
|
-
(0, _vitest.expect)(result.isMatch).toBe(true);
|
|
58
|
-
});
|
|
59
|
-
(0, _vitest.it)("Text should hydrate without mismatch", async () => {
|
|
60
|
-
const result = await (0, _ssr.testHydration)(_text.default, {
|
|
61
|
-
type: "danger",
|
|
62
|
-
bold: true
|
|
63
|
-
}, {
|
|
64
|
-
default: () => "Hydrate Text"
|
|
65
|
-
});
|
|
66
|
-
(0, _vitest.expect)(result.isMatch).toBe(true);
|
|
67
|
-
});
|
|
68
|
-
(0, _vitest.it)("Paragraph should hydrate without mismatch", async () => {
|
|
69
|
-
const result = await (0, _ssr.testHydration)(_paragraph.default, {
|
|
70
|
-
spacing: "compact"
|
|
71
|
-
}, {
|
|
72
|
-
default: () => "Hydrate Paragraph"
|
|
73
|
-
});
|
|
74
|
-
(0, _vitest.expect)(result.isMatch).toBe(true);
|
|
75
|
-
});
|
|
76
|
-
(0, _vitest.it)("Link should hydrate without mismatch", async () => {
|
|
77
|
-
const result = await (0, _ssr.testHydration)(_link.default, {
|
|
78
|
-
href: "#",
|
|
79
|
-
underline: true
|
|
80
|
-
}, {
|
|
81
|
-
default: () => "Hydrate Link"
|
|
82
|
-
});
|
|
83
|
-
(0, _vitest.expect)(result.isMatch).toBe(true);
|
|
84
|
-
});
|
|
85
|
-
});
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import Title from "../src/title.vue";
|
|
3
|
-
import Text from "../src/text.vue";
|
|
4
|
-
import Paragraph from "../src/paragraph.vue";
|
|
5
|
-
import Link from "../src/link.vue";
|
|
6
|
-
import { renderSSR, expectSSRHasClass, testHydration } from "../../__tests__/utils/ssr.mjs";
|
|
7
|
-
describe("YhTypography SSR", () => {
|
|
8
|
-
it("Title should render h2 in SSR", async () => {
|
|
9
|
-
const html = await renderSSR(Title, { level: 2 }, { default: () => "SSR Title" });
|
|
10
|
-
expect(html).toContain("<h2");
|
|
11
|
-
expect(html).toContain("SSR Title");
|
|
12
|
-
expectSSRHasClass(html, "yh-typography__title");
|
|
13
|
-
});
|
|
14
|
-
it("Text should render span in SSR", async () => {
|
|
15
|
-
const html = await renderSSR(Text, { type: "success" }, { default: () => "SSR Text" });
|
|
16
|
-
expect(html).toContain("SSR Text");
|
|
17
|
-
expectSSRHasClass(html, "yh-typography__text--success");
|
|
18
|
-
});
|
|
19
|
-
it("Paragraph should render p in SSR", async () => {
|
|
20
|
-
const html = await renderSSR(Paragraph, { align: "center" }, { default: () => "SSR Paragraph" });
|
|
21
|
-
expect(html).toContain("<p");
|
|
22
|
-
expect(html).toContain("SSR Paragraph");
|
|
23
|
-
expectSSRHasClass(html, "yh-typography__paragraph--center");
|
|
24
|
-
});
|
|
25
|
-
it("Link should render a in SSR", async () => {
|
|
26
|
-
const html = await renderSSR(
|
|
27
|
-
Link,
|
|
28
|
-
{ href: "https://example.com", target: "_blank" },
|
|
29
|
-
{ default: () => "Link" }
|
|
30
|
-
);
|
|
31
|
-
expect(html).toContain("<a");
|
|
32
|
-
expect(html).toContain('href="https://example.com"');
|
|
33
|
-
expect(html).toContain('target="_blank"');
|
|
34
|
-
});
|
|
35
|
-
it("Title should hydrate without mismatch", async () => {
|
|
36
|
-
const result = await testHydration(Title, { level: 3 }, { default: () => "Hydrate Title" });
|
|
37
|
-
expect(result.isMatch).toBe(true);
|
|
38
|
-
});
|
|
39
|
-
it("Text should hydrate without mismatch", async () => {
|
|
40
|
-
const result = await testHydration(
|
|
41
|
-
Text,
|
|
42
|
-
{ type: "danger", bold: true },
|
|
43
|
-
{ default: () => "Hydrate Text" }
|
|
44
|
-
);
|
|
45
|
-
expect(result.isMatch).toBe(true);
|
|
46
|
-
});
|
|
47
|
-
it("Paragraph should hydrate without mismatch", async () => {
|
|
48
|
-
const result = await testHydration(
|
|
49
|
-
Paragraph,
|
|
50
|
-
{ spacing: "compact" },
|
|
51
|
-
{ default: () => "Hydrate Paragraph" }
|
|
52
|
-
);
|
|
53
|
-
expect(result.isMatch).toBe(true);
|
|
54
|
-
});
|
|
55
|
-
it("Link should hydrate without mismatch", async () => {
|
|
56
|
-
const result = await testHydration(
|
|
57
|
-
Link,
|
|
58
|
-
{ href: "#", underline: true },
|
|
59
|
-
{ default: () => "Hydrate Link" }
|
|
60
|
-
);
|
|
61
|
-
expect(result.isMatch).toBe(true);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
@@ -1,362 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _vitest = require("vitest");
|
|
4
|
-
var _testUtils = require("@vue/test-utils");
|
|
5
|
-
var _title = _interopRequireDefault(require("../src/title.vue"));
|
|
6
|
-
var _text = _interopRequireDefault(require("../src/text.vue"));
|
|
7
|
-
var _paragraph = _interopRequireDefault(require("../src/paragraph.vue"));
|
|
8
|
-
var _link = _interopRequireDefault(require("../src/link.vue"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
(0, _vitest.describe)("YhTypographyTitle", () => {
|
|
11
|
-
(0, _vitest.it)("\u5E94\u8BE5\u6E32\u67D3\u6B63\u786E\u7684\u6807\u9898\u7EA7\u522B", () => {
|
|
12
|
-
const wrapper = (0, _testUtils.mount)(_title.default, {
|
|
13
|
-
props: {
|
|
14
|
-
level: 2
|
|
15
|
-
},
|
|
16
|
-
slots: {
|
|
17
|
-
default: "\u6807\u9898"
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
(0, _vitest.expect)(wrapper.find("h2").exists()).toBe(true);
|
|
21
|
-
(0, _vitest.expect)(wrapper.text()).toBe("\u6807\u9898");
|
|
22
|
-
});
|
|
23
|
-
(0, _vitest.it)("\u9ED8\u8BA4\u6E32\u67D3 h1", () => {
|
|
24
|
-
const wrapper = (0, _testUtils.mount)(_title.default, {
|
|
25
|
-
slots: {
|
|
26
|
-
default: "\u6807\u9898"
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
(0, _vitest.expect)(wrapper.find("h1").exists()).toBe(true);
|
|
30
|
-
});
|
|
31
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 h1-h6 \u5168\u90E8\u7EA7\u522B", () => {
|
|
32
|
-
for (let level = 1; level <= 6; level++) {
|
|
33
|
-
const wrapper = (0, _testUtils.mount)(_title.default, {
|
|
34
|
-
props: {
|
|
35
|
-
level
|
|
36
|
-
},
|
|
37
|
-
slots: {
|
|
38
|
-
default: "T"
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
(0, _vitest.expect)(wrapper.find(`h${level}`).exists()).toBe(true);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 type \u7C7B\u578B", () => {
|
|
45
|
-
const wrapper = (0, _testUtils.mount)(_title.default, {
|
|
46
|
-
props: {
|
|
47
|
-
type: "danger"
|
|
48
|
-
},
|
|
49
|
-
slots: {
|
|
50
|
-
default: "\u9519\u8BEF"
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
(0, _vitest.expect)(wrapper.find("h1").classes()).toContain("yh-typography__title--danger");
|
|
54
|
-
});
|
|
55
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 bold \u4FEE\u9970", () => {
|
|
56
|
-
const wrapper = (0, _testUtils.mount)(_title.default, {
|
|
57
|
-
props: {
|
|
58
|
-
bold: true
|
|
59
|
-
},
|
|
60
|
-
slots: {
|
|
61
|
-
default: "\u52A0\u7C97"
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
(0, _vitest.expect)(wrapper.find("h1").classes()).toContain("is-bold");
|
|
65
|
-
});
|
|
66
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 delete \u4FEE\u9970", () => {
|
|
67
|
-
const wrapper = (0, _testUtils.mount)(_title.default, {
|
|
68
|
-
props: {
|
|
69
|
-
delete: true
|
|
70
|
-
},
|
|
71
|
-
slots: {
|
|
72
|
-
default: "\u5220\u9664"
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
(0, _vitest.expect)(wrapper.find("h1").classes()).toContain("is-delete");
|
|
76
|
-
});
|
|
77
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 italic \u4FEE\u9970", () => {
|
|
78
|
-
const wrapper = (0, _testUtils.mount)(_title.default, {
|
|
79
|
-
props: {
|
|
80
|
-
italic: true
|
|
81
|
-
},
|
|
82
|
-
slots: {
|
|
83
|
-
default: "\u659C\u4F53"
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
(0, _vitest.expect)(wrapper.find("h1").classes()).toContain("is-italic");
|
|
87
|
-
});
|
|
88
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 mark \u6807\u8BB0", () => {
|
|
89
|
-
const wrapper = (0, _testUtils.mount)(_title.default, {
|
|
90
|
-
props: {
|
|
91
|
-
mark: true
|
|
92
|
-
},
|
|
93
|
-
slots: {
|
|
94
|
-
default: "\u6807\u8BB0"
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
(0, _vitest.expect)(wrapper.find("mark").exists()).toBe(true);
|
|
98
|
-
});
|
|
99
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 code \u4EE3\u7801", () => {
|
|
100
|
-
const wrapper = (0, _testUtils.mount)(_title.default, {
|
|
101
|
-
props: {
|
|
102
|
-
code: true
|
|
103
|
-
},
|
|
104
|
-
slots: {
|
|
105
|
-
default: "\u4EE3\u7801"
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
(0, _vitest.expect)(wrapper.find("code").exists()).toBe(true);
|
|
109
|
-
});
|
|
110
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 ellipsis \u7701\u7565", () => {
|
|
111
|
-
const wrapper = (0, _testUtils.mount)(_title.default, {
|
|
112
|
-
props: {
|
|
113
|
-
ellipsis: true
|
|
114
|
-
},
|
|
115
|
-
slots: {
|
|
116
|
-
default: "\u7701\u7565"
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
(0, _vitest.expect)(wrapper.find("h1").classes()).toContain("is-ellipsis");
|
|
120
|
-
});
|
|
121
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301\u81EA\u5B9A\u4E49 tag", () => {
|
|
122
|
-
const wrapper = (0, _testUtils.mount)(_title.default, {
|
|
123
|
-
props: {
|
|
124
|
-
tag: "div"
|
|
125
|
-
},
|
|
126
|
-
slots: {
|
|
127
|
-
default: "\u81EA\u5B9A\u4E49"
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
(0, _vitest.expect)(wrapper.find("div").exists()).toBe(true);
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
(0, _vitest.describe)("YhTypographyText", () => {
|
|
134
|
-
(0, _vitest.it)("\u5E94\u8BE5\u9ED8\u8BA4\u6E32\u67D3 span", () => {
|
|
135
|
-
const wrapper = (0, _testUtils.mount)(_text.default, {
|
|
136
|
-
slots: {
|
|
137
|
-
default: "\u6587\u672C"
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
(0, _vitest.expect)(wrapper.find("span").exists()).toBe(true);
|
|
141
|
-
(0, _vitest.expect)(wrapper.text()).toBe("\u6587\u672C");
|
|
142
|
-
});
|
|
143
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 type", () => {
|
|
144
|
-
const wrapper = (0, _testUtils.mount)(_text.default, {
|
|
145
|
-
props: {
|
|
146
|
-
type: "success"
|
|
147
|
-
},
|
|
148
|
-
slots: {
|
|
149
|
-
default: "\u6210\u529F"
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
(0, _vitest.expect)(wrapper.find("span").classes()).toContain("yh-typography__text--success");
|
|
153
|
-
});
|
|
154
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 size", () => {
|
|
155
|
-
const wrapper = (0, _testUtils.mount)(_text.default, {
|
|
156
|
-
props: {
|
|
157
|
-
size: "large"
|
|
158
|
-
},
|
|
159
|
-
slots: {
|
|
160
|
-
default: "\u5927\u53F7"
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
(0, _vitest.expect)(wrapper.find("span").classes()).toContain("yh-typography__text--large");
|
|
164
|
-
});
|
|
165
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 keyboard \u6837\u5F0F", () => {
|
|
166
|
-
const wrapper = (0, _testUtils.mount)(_text.default, {
|
|
167
|
-
props: {
|
|
168
|
-
keyboard: true
|
|
169
|
-
},
|
|
170
|
-
slots: {
|
|
171
|
-
default: "Ctrl"
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
(0, _vitest.expect)(wrapper.find("kbd").exists()).toBe(true);
|
|
175
|
-
});
|
|
176
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 bold \u4FEE\u9970", () => {
|
|
177
|
-
const wrapper = (0, _testUtils.mount)(_text.default, {
|
|
178
|
-
props: {
|
|
179
|
-
bold: true
|
|
180
|
-
},
|
|
181
|
-
slots: {
|
|
182
|
-
default: "\u52A0\u7C97"
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
(0, _vitest.expect)(wrapper.find("span").classes()).toContain("is-bold");
|
|
186
|
-
});
|
|
187
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 mark \u6807\u8BB0", () => {
|
|
188
|
-
const wrapper = (0, _testUtils.mount)(_text.default, {
|
|
189
|
-
props: {
|
|
190
|
-
mark: true
|
|
191
|
-
},
|
|
192
|
-
slots: {
|
|
193
|
-
default: "\u6807\u8BB0"
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
(0, _vitest.expect)(wrapper.find("mark").exists()).toBe(true);
|
|
197
|
-
});
|
|
198
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301\u81EA\u5B9A\u4E49 tag", () => {
|
|
199
|
-
const wrapper = (0, _testUtils.mount)(_text.default, {
|
|
200
|
-
props: {
|
|
201
|
-
tag: "strong"
|
|
202
|
-
},
|
|
203
|
-
slots: {
|
|
204
|
-
default: "\u5F3A\u8C03"
|
|
205
|
-
}
|
|
206
|
-
});
|
|
207
|
-
(0, _vitest.expect)(wrapper.find("strong").exists()).toBe(true);
|
|
208
|
-
});
|
|
209
|
-
});
|
|
210
|
-
(0, _vitest.describe)("YhTypographyParagraph", () => {
|
|
211
|
-
(0, _vitest.it)("\u5E94\u8BE5\u6E32\u67D3 p \u6807\u7B7E", () => {
|
|
212
|
-
const wrapper = (0, _testUtils.mount)(_paragraph.default, {
|
|
213
|
-
slots: {
|
|
214
|
-
default: "\u6BB5\u843D"
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
(0, _vitest.expect)(wrapper.find("p").exists()).toBe(true);
|
|
218
|
-
});
|
|
219
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 type", () => {
|
|
220
|
-
const wrapper = (0, _testUtils.mount)(_paragraph.default, {
|
|
221
|
-
props: {
|
|
222
|
-
type: "warning"
|
|
223
|
-
},
|
|
224
|
-
slots: {
|
|
225
|
-
default: "\u8B66\u544A"
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
(0, _vitest.expect)(wrapper.find("p").classes()).toContain("yh-typography__paragraph--warning");
|
|
229
|
-
});
|
|
230
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 align", () => {
|
|
231
|
-
const wrapper = (0, _testUtils.mount)(_paragraph.default, {
|
|
232
|
-
props: {
|
|
233
|
-
align: "center"
|
|
234
|
-
},
|
|
235
|
-
slots: {
|
|
236
|
-
default: "\u5C45\u4E2D"
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
(0, _vitest.expect)(wrapper.find("p").classes()).toContain("yh-typography__paragraph--center");
|
|
240
|
-
});
|
|
241
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 spacing", () => {
|
|
242
|
-
const wrapper = (0, _testUtils.mount)(_paragraph.default, {
|
|
243
|
-
props: {
|
|
244
|
-
spacing: "compact"
|
|
245
|
-
},
|
|
246
|
-
slots: {
|
|
247
|
-
default: "\u7D27\u51D1"
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
(0, _vitest.expect)(wrapper.find("p").classes()).toContain("yh-typography__paragraph--compact");
|
|
251
|
-
});
|
|
252
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 mark \u6807\u8BB0", () => {
|
|
253
|
-
const wrapper = (0, _testUtils.mount)(_paragraph.default, {
|
|
254
|
-
props: {
|
|
255
|
-
mark: true
|
|
256
|
-
},
|
|
257
|
-
slots: {
|
|
258
|
-
default: "\u9AD8\u4EAE"
|
|
259
|
-
}
|
|
260
|
-
});
|
|
261
|
-
(0, _vitest.expect)(wrapper.find("mark").exists()).toBe(true);
|
|
262
|
-
});
|
|
263
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301\u591A\u884C\u7701\u7565 (number)", () => {
|
|
264
|
-
const wrapper = (0, _testUtils.mount)(_paragraph.default, {
|
|
265
|
-
props: {
|
|
266
|
-
ellipsis: 3
|
|
267
|
-
},
|
|
268
|
-
slots: {
|
|
269
|
-
default: "\u591A\u884C\u7701\u7565"
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
const style = wrapper.find("p").attributes("style") || "";
|
|
273
|
-
(0, _vitest.expect)(style).toContain("overflow: hidden");
|
|
274
|
-
});
|
|
275
|
-
});
|
|
276
|
-
(0, _vitest.describe)("YhTypographyLink", () => {
|
|
277
|
-
(0, _vitest.it)("\u5E94\u8BE5\u6E32\u67D3 a \u6807\u7B7E", () => {
|
|
278
|
-
const wrapper = (0, _testUtils.mount)(_link.default, {
|
|
279
|
-
props: {
|
|
280
|
-
href: "https://example.com"
|
|
281
|
-
},
|
|
282
|
-
slots: {
|
|
283
|
-
default: "\u94FE\u63A5"
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
(0, _vitest.expect)(wrapper.find("a").exists()).toBe(true);
|
|
287
|
-
(0, _vitest.expect)(wrapper.find("a").attributes("href")).toBe("https://example.com");
|
|
288
|
-
});
|
|
289
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 target", () => {
|
|
290
|
-
const wrapper = (0, _testUtils.mount)(_link.default, {
|
|
291
|
-
props: {
|
|
292
|
-
href: "#",
|
|
293
|
-
target: "_blank"
|
|
294
|
-
},
|
|
295
|
-
slots: {
|
|
296
|
-
default: "\u65B0\u7A97\u53E3"
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
(0, _vitest.expect)(wrapper.find("a").attributes("target")).toBe("_blank");
|
|
300
|
-
});
|
|
301
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 underline", () => {
|
|
302
|
-
const wrapper = (0, _testUtils.mount)(_link.default, {
|
|
303
|
-
props: {
|
|
304
|
-
underline: true
|
|
305
|
-
},
|
|
306
|
-
slots: {
|
|
307
|
-
default: "\u4E0B\u5212\u7EBF"
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
(0, _vitest.expect)(wrapper.find("a").classes()).toContain("is-underline");
|
|
311
|
-
});
|
|
312
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 disabled", () => {
|
|
313
|
-
const wrapper = (0, _testUtils.mount)(_link.default, {
|
|
314
|
-
props: {
|
|
315
|
-
href: "#",
|
|
316
|
-
disabled: true
|
|
317
|
-
},
|
|
318
|
-
slots: {
|
|
319
|
-
default: "\u7981\u7528"
|
|
320
|
-
}
|
|
321
|
-
});
|
|
322
|
-
(0, _vitest.expect)(wrapper.find("a").classes()).toContain("is-disabled");
|
|
323
|
-
(0, _vitest.expect)(wrapper.find("a").attributes("href")).toBeUndefined();
|
|
324
|
-
(0, _vitest.expect)(wrapper.find("a").attributes("aria-disabled")).toBe("true");
|
|
325
|
-
(0, _vitest.expect)(wrapper.find("a").attributes("tabindex")).toBe("-1");
|
|
326
|
-
});
|
|
327
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301 type", () => {
|
|
328
|
-
const wrapper = (0, _testUtils.mount)(_link.default, {
|
|
329
|
-
props: {
|
|
330
|
-
type: "danger"
|
|
331
|
-
},
|
|
332
|
-
slots: {
|
|
333
|
-
default: "\u5371\u9669"
|
|
334
|
-
}
|
|
335
|
-
});
|
|
336
|
-
(0, _vitest.expect)(wrapper.find("a").classes()).toContain("yh-typography__link--danger");
|
|
337
|
-
});
|
|
338
|
-
(0, _vitest.it)("\u7981\u7528\u65F6\u70B9\u51FB\u4E0D\u89E6\u53D1\u4E8B\u4EF6", async () => {
|
|
339
|
-
const wrapper = (0, _testUtils.mount)(_link.default, {
|
|
340
|
-
props: {
|
|
341
|
-
disabled: true
|
|
342
|
-
},
|
|
343
|
-
slots: {
|
|
344
|
-
default: "\u7981\u7528"
|
|
345
|
-
}
|
|
346
|
-
});
|
|
347
|
-
await wrapper.find("a").trigger("click");
|
|
348
|
-
(0, _vitest.expect)(wrapper.emitted("click")).toBeFalsy();
|
|
349
|
-
});
|
|
350
|
-
(0, _vitest.it)("\u542F\u7528\u65F6\u70B9\u51FB\u5E94\u89E6\u53D1\u4E8B\u4EF6", async () => {
|
|
351
|
-
const wrapper = (0, _testUtils.mount)(_link.default, {
|
|
352
|
-
props: {
|
|
353
|
-
href: "#"
|
|
354
|
-
},
|
|
355
|
-
slots: {
|
|
356
|
-
default: "\u94FE\u63A5"
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
await wrapper.find("a").trigger("click");
|
|
360
|
-
(0, _vitest.expect)(wrapper.emitted("click")).toBeTruthy();
|
|
361
|
-
});
|
|
362
|
-
});
|