@yh-ui/components 0.1.21 → 0.1.22
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/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 +6 -6
- 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,125 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { mount } from "@vue/test-utils";
|
|
3
|
-
import Avatar from "../src/avatar.vue";
|
|
4
|
-
describe("YhAvatar \u7EC4\u4EF6", () => {
|
|
5
|
-
it("\u5E94\u8BE5\u6B63\u786E\u6E32\u67D3\u57FA\u7840\u7ED3\u6784", () => {
|
|
6
|
-
const wrapper = mount(Avatar);
|
|
7
|
-
expect(wrapper.find(".yh-avatar").exists()).toBe(true);
|
|
8
|
-
});
|
|
9
|
-
it("\u5E94\u8BE5\u9ED8\u8BA4\u4E3A\u5706\u5F62", () => {
|
|
10
|
-
const wrapper = mount(Avatar);
|
|
11
|
-
expect(wrapper.find(".yh-avatar").classes()).toContain("yh-avatar--circle");
|
|
12
|
-
});
|
|
13
|
-
it("\u5E94\u8BE5\u652F\u6301\u65B9\u5F62", () => {
|
|
14
|
-
const wrapper = mount(Avatar, {
|
|
15
|
-
props: { shape: "square" }
|
|
16
|
-
});
|
|
17
|
-
expect(wrapper.find(".yh-avatar").classes()).toContain("yh-avatar--square");
|
|
18
|
-
});
|
|
19
|
-
it("\u5E94\u8BE5\u652F\u6301\u9884\u8BBE\u5C3A\u5BF8 small", () => {
|
|
20
|
-
const wrapper = mount(Avatar, {
|
|
21
|
-
props: { size: "small" }
|
|
22
|
-
});
|
|
23
|
-
expect(wrapper.find(".yh-avatar").classes()).toContain("yh-avatar--small");
|
|
24
|
-
});
|
|
25
|
-
it("\u5E94\u8BE5\u652F\u6301\u9884\u8BBE\u5C3A\u5BF8 large", () => {
|
|
26
|
-
const wrapper = mount(Avatar, {
|
|
27
|
-
props: { size: "large" }
|
|
28
|
-
});
|
|
29
|
-
expect(wrapper.find(".yh-avatar").classes()).toContain("yh-avatar--large");
|
|
30
|
-
});
|
|
31
|
-
it("\u5E94\u8BE5\u652F\u6301\u81EA\u5B9A\u4E49\u6570\u5B57\u5C3A\u5BF8", () => {
|
|
32
|
-
const wrapper = mount(Avatar, {
|
|
33
|
-
props: { size: 80 }
|
|
34
|
-
});
|
|
35
|
-
const style = wrapper.find(".yh-avatar").attributes("style");
|
|
36
|
-
expect(style).toContain("width: 80px");
|
|
37
|
-
expect(style).toContain("height: 80px");
|
|
38
|
-
});
|
|
39
|
-
it("\u5E94\u8BE5\u6B63\u786E\u6E32\u67D3\u56FE\u7247", () => {
|
|
40
|
-
const src = "https://example.com/avatar.png";
|
|
41
|
-
const wrapper = mount(Avatar, {
|
|
42
|
-
props: { src }
|
|
43
|
-
});
|
|
44
|
-
const img = wrapper.find(".yh-avatar__img");
|
|
45
|
-
expect(img.exists()).toBe(true);
|
|
46
|
-
expect(img.attributes("src")).toBe(src);
|
|
47
|
-
});
|
|
48
|
-
it("\u5E94\u8BE5\u652F\u6301 alt \u5C5E\u6027", () => {
|
|
49
|
-
const wrapper = mount(Avatar, {
|
|
50
|
-
props: {
|
|
51
|
-
src: "https://example.com/avatar.png",
|
|
52
|
-
alt: "\u7528\u6237\u5934\u50CF"
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
expect(wrapper.find(".yh-avatar__img").attributes("alt")).toBe("\u7528\u6237\u5934\u50CF");
|
|
56
|
-
expect(wrapper.find(".yh-avatar").attributes("aria-label")).toBe("\u7528\u6237\u5934\u50CF");
|
|
57
|
-
});
|
|
58
|
-
it("\u5E94\u8BE5\u652F\u6301 srcSet \u5C5E\u6027", () => {
|
|
59
|
-
const srcSet = "https://example.com/avatar-2x.png 2x";
|
|
60
|
-
const wrapper = mount(Avatar, {
|
|
61
|
-
props: {
|
|
62
|
-
src: "https://example.com/avatar.png",
|
|
63
|
-
srcSet
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
expect(wrapper.find(".yh-avatar__img").attributes("srcset")).toBe(srcSet);
|
|
67
|
-
});
|
|
68
|
-
it("\u5E94\u8BE5\u652F\u6301 fit \u5C5E\u6027", () => {
|
|
69
|
-
const wrapper = mount(Avatar, {
|
|
70
|
-
props: {
|
|
71
|
-
src: "https://example.com/avatar.png",
|
|
72
|
-
fit: "contain"
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
const imgStyle = wrapper.find(".yh-avatar__img").attributes("style");
|
|
76
|
-
expect(imgStyle).toContain("object-fit: contain");
|
|
77
|
-
});
|
|
78
|
-
it("\u5E94\u8BE5\u6B63\u786E\u5904\u7406\u56FE\u7247\u52A0\u8F7D\u5931\u8D25", async () => {
|
|
79
|
-
const wrapper = mount(Avatar, {
|
|
80
|
-
props: { src: "https://invalid-url.com/avatar.png" }
|
|
81
|
-
});
|
|
82
|
-
await wrapper.find(".yh-avatar__img").trigger("error");
|
|
83
|
-
expect(wrapper.find(".yh-avatar__img").exists()).toBe(false);
|
|
84
|
-
expect(wrapper.emitted("error")).toBeTruthy();
|
|
85
|
-
expect(wrapper.emitted("error").length).toBe(1);
|
|
86
|
-
});
|
|
87
|
-
it("\u5E94\u8BE5\u5728\u56FE\u7247\u52A0\u8F7D\u5931\u8D25\u540E\u663E\u793A\u9ED8\u8BA4\u63D2\u69FD", async () => {
|
|
88
|
-
const wrapper = mount(Avatar, {
|
|
89
|
-
props: { src: "https://invalid-url.com/avatar.png" },
|
|
90
|
-
slots: {
|
|
91
|
-
default: '<span class="fallback">FB</span>'
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
await wrapper.find(".yh-avatar__img").trigger("error");
|
|
95
|
-
expect(wrapper.find(".fallback").exists()).toBe(true);
|
|
96
|
-
expect(wrapper.find(".fallback").text()).toBe("FB");
|
|
97
|
-
});
|
|
98
|
-
it("\u5E94\u8BE5\u652F\u6301\u9ED8\u8BA4\u63D2\u69FD\u663E\u793A\u6587\u5B57", () => {
|
|
99
|
-
const wrapper = mount(Avatar, {
|
|
100
|
-
slots: {
|
|
101
|
-
default: "YH"
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
expect(wrapper.text()).toContain("YH");
|
|
105
|
-
expect(wrapper.find(".yh-avatar__img").exists()).toBe(false);
|
|
106
|
-
});
|
|
107
|
-
it("\u5E94\u8BE5\u652F\u6301\u81EA\u5B9A\u4E49\u80CC\u666F\u8272 backgroundColor", () => {
|
|
108
|
-
const wrapper = mount(Avatar, {
|
|
109
|
-
props: { backgroundColor: "#F56C6C" }
|
|
110
|
-
});
|
|
111
|
-
const style = wrapper.find(".yh-avatar").attributes("style");
|
|
112
|
-
expect(style).toContain("background-color");
|
|
113
|
-
});
|
|
114
|
-
it("\u5E94\u8BE5\u652F\u6301\u65E7 API color \u5C5E\u6027\u4F5C\u4E3A\u80CC\u666F\u8272", () => {
|
|
115
|
-
const wrapper = mount(Avatar, {
|
|
116
|
-
props: { color: "#67C23A" }
|
|
117
|
-
});
|
|
118
|
-
const style = wrapper.find(".yh-avatar").attributes("style");
|
|
119
|
-
expect(style).toContain("background-color");
|
|
120
|
-
});
|
|
121
|
-
it("\u5E94\u8BE5\u6709 role=img", () => {
|
|
122
|
-
const wrapper = mount(Avatar);
|
|
123
|
-
expect(wrapper.find(".yh-avatar").attributes("role")).toBe("img");
|
|
124
|
-
});
|
|
125
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _vitest = require("vitest");
|
|
4
|
-
var _serverRenderer = require("@vue/server-renderer");
|
|
5
|
-
var _vue = require("vue");
|
|
6
|
-
var _backTop = _interopRequireDefault(require("../src/back-top.vue"));
|
|
7
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
-
(0, _vitest.describe)("YhBackTop SSR", () => {
|
|
9
|
-
(0, _vitest.it)("should render on server without error", async () => {
|
|
10
|
-
const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_backTop.default));
|
|
11
|
-
(0, _vitest.expect)(html).toBeDefined();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { renderToString } from "@vue/server-renderer";
|
|
3
|
-
import { h } from "vue";
|
|
4
|
-
import BackTop from "../src/back-top.vue";
|
|
5
|
-
describe("YhBackTop SSR", () => {
|
|
6
|
-
it("should render on server without error", async () => {
|
|
7
|
-
const html = await renderToString(h(BackTop));
|
|
8
|
-
expect(html).toBeDefined();
|
|
9
|
-
});
|
|
10
|
-
});
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _testUtils = require("@vue/test-utils");
|
|
4
|
-
var _vitest = require("vitest");
|
|
5
|
-
var _vue = require("vue");
|
|
6
|
-
var _backTop = _interopRequireDefault(require("../src/back-top.vue"));
|
|
7
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
-
(0, _vitest.describe)("YhBackTop", () => {
|
|
9
|
-
let container;
|
|
10
|
-
(0, _vitest.beforeEach)(() => {
|
|
11
|
-
_vitest.vi.useFakeTimers();
|
|
12
|
-
container = document.createElement("div");
|
|
13
|
-
container.id = "scroll-container";
|
|
14
|
-
Object.defineProperty(container, "scrollTop", {
|
|
15
|
-
value: 0,
|
|
16
|
-
writable: true
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(container, "scrollHeight", {
|
|
19
|
-
value: 2e3,
|
|
20
|
-
writable: true
|
|
21
|
-
});
|
|
22
|
-
Object.defineProperty(container, "clientHeight", {
|
|
23
|
-
value: 500,
|
|
24
|
-
writable: true
|
|
25
|
-
});
|
|
26
|
-
document.body.appendChild(container);
|
|
27
|
-
});
|
|
28
|
-
(0, _vitest.afterEach)(() => {
|
|
29
|
-
_vitest.vi.useRealTimers();
|
|
30
|
-
_vitest.vi.unstubAllGlobals();
|
|
31
|
-
document.body.removeChild(container);
|
|
32
|
-
});
|
|
33
|
-
(0, _vitest.it)("should be invisible initially", () => {
|
|
34
|
-
const wrapper = (0, _testUtils.mount)(_backTop.default, {
|
|
35
|
-
props: {
|
|
36
|
-
target: "#scroll-container",
|
|
37
|
-
visibilityHeight: 200
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
(0, _vitest.expect)(wrapper.find(".yh-back-top").exists()).toBe(false);
|
|
41
|
-
});
|
|
42
|
-
(0, _vitest.it)("should be visible after scrolling down", async () => {
|
|
43
|
-
const wrapper = (0, _testUtils.mount)(_backTop.default, {
|
|
44
|
-
props: {
|
|
45
|
-
target: "#scroll-container",
|
|
46
|
-
visibilityHeight: 100
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
container.scrollTop = 150;
|
|
50
|
-
wrapper.vm.handleScroll();
|
|
51
|
-
_vitest.vi.advanceTimersByTime(16);
|
|
52
|
-
await (0, _vue.nextTick)();
|
|
53
|
-
(0, _vitest.expect)(wrapper.find(".yh-back-top").exists()).toBe(true);
|
|
54
|
-
});
|
|
55
|
-
(0, _vitest.it)("should show progress circle when showProgress is true", async () => {
|
|
56
|
-
const wrapper = (0, _testUtils.mount)(_backTop.default, {
|
|
57
|
-
props: {
|
|
58
|
-
target: "#scroll-container",
|
|
59
|
-
visibilityHeight: 0,
|
|
60
|
-
showProgress: true
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
container.scrollTop = 500;
|
|
64
|
-
wrapper.vm.handleScroll();
|
|
65
|
-
_vitest.vi.advanceTimersByTime(16);
|
|
66
|
-
await (0, _vue.nextTick)();
|
|
67
|
-
(0, _vitest.expect)(wrapper.find(".yh-back-top__progress").exists()).toBe(true);
|
|
68
|
-
});
|
|
69
|
-
(0, _vitest.it)("should scroll to top on click", async () => {
|
|
70
|
-
const wrapper = (0, _testUtils.mount)(_backTop.default, {
|
|
71
|
-
props: {
|
|
72
|
-
target: "#scroll-container",
|
|
73
|
-
visibilityHeight: 0,
|
|
74
|
-
duration: 100
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
container.scrollTop = 500;
|
|
78
|
-
wrapper.vm.handleScroll();
|
|
79
|
-
_vitest.vi.advanceTimersByTime(16);
|
|
80
|
-
await (0, _vue.nextTick)();
|
|
81
|
-
const scrollToSpy = _vitest.vi.fn();
|
|
82
|
-
container.scrollTo = scrollToSpy;
|
|
83
|
-
await wrapper.find(".yh-back-top").trigger("click");
|
|
84
|
-
_vitest.vi.advanceTimersByTime(200);
|
|
85
|
-
(0, _vitest.expect)(scrollToSpy).toHaveBeenCalled();
|
|
86
|
-
(0, _vitest.expect)(wrapper.emitted("click")).toBeTruthy();
|
|
87
|
-
});
|
|
88
|
-
});
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { mount } from "@vue/test-utils";
|
|
2
|
-
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
|
3
|
-
import { nextTick } from "vue";
|
|
4
|
-
import YhBackTop from "../src/back-top.vue";
|
|
5
|
-
describe("YhBackTop", () => {
|
|
6
|
-
let container;
|
|
7
|
-
beforeEach(() => {
|
|
8
|
-
vi.useFakeTimers();
|
|
9
|
-
container = document.createElement("div");
|
|
10
|
-
container.id = "scroll-container";
|
|
11
|
-
Object.defineProperty(container, "scrollTop", { value: 0, writable: true });
|
|
12
|
-
Object.defineProperty(container, "scrollHeight", { value: 2e3, writable: true });
|
|
13
|
-
Object.defineProperty(container, "clientHeight", { value: 500, writable: true });
|
|
14
|
-
document.body.appendChild(container);
|
|
15
|
-
});
|
|
16
|
-
afterEach(() => {
|
|
17
|
-
vi.useRealTimers();
|
|
18
|
-
vi.unstubAllGlobals();
|
|
19
|
-
document.body.removeChild(container);
|
|
20
|
-
});
|
|
21
|
-
it("should be invisible initially", () => {
|
|
22
|
-
const wrapper = mount(YhBackTop, {
|
|
23
|
-
props: {
|
|
24
|
-
target: "#scroll-container",
|
|
25
|
-
visibilityHeight: 200
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
expect(wrapper.find(".yh-back-top").exists()).toBe(false);
|
|
29
|
-
});
|
|
30
|
-
it("should be visible after scrolling down", async () => {
|
|
31
|
-
const wrapper = mount(YhBackTop, {
|
|
32
|
-
props: {
|
|
33
|
-
target: "#scroll-container",
|
|
34
|
-
visibilityHeight: 100
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
container.scrollTop = 150;
|
|
38
|
-
wrapper.vm.handleScroll();
|
|
39
|
-
vi.advanceTimersByTime(16);
|
|
40
|
-
await nextTick();
|
|
41
|
-
expect(wrapper.find(".yh-back-top").exists()).toBe(true);
|
|
42
|
-
});
|
|
43
|
-
it("should show progress circle when showProgress is true", async () => {
|
|
44
|
-
const wrapper = mount(YhBackTop, {
|
|
45
|
-
props: {
|
|
46
|
-
target: "#scroll-container",
|
|
47
|
-
visibilityHeight: 0,
|
|
48
|
-
showProgress: true
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
container.scrollTop = 500;
|
|
52
|
-
wrapper.vm.handleScroll();
|
|
53
|
-
vi.advanceTimersByTime(16);
|
|
54
|
-
await nextTick();
|
|
55
|
-
expect(wrapper.find(".yh-back-top__progress").exists()).toBe(true);
|
|
56
|
-
});
|
|
57
|
-
it("should scroll to top on click", async () => {
|
|
58
|
-
const wrapper = mount(YhBackTop, {
|
|
59
|
-
props: {
|
|
60
|
-
target: "#scroll-container",
|
|
61
|
-
visibilityHeight: 0,
|
|
62
|
-
duration: 100
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
container.scrollTop = 500;
|
|
66
|
-
wrapper.vm.handleScroll();
|
|
67
|
-
vi.advanceTimersByTime(16);
|
|
68
|
-
await nextTick();
|
|
69
|
-
const scrollToSpy = vi.fn();
|
|
70
|
-
container.scrollTo = scrollToSpy;
|
|
71
|
-
await wrapper.find(".yh-back-top").trigger("click");
|
|
72
|
-
vi.advanceTimersByTime(200);
|
|
73
|
-
expect(scrollToSpy).toHaveBeenCalled();
|
|
74
|
-
expect(wrapper.emitted("click")).toBeTruthy();
|
|
75
|
-
});
|
|
76
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _vitest = require("vitest");
|
|
4
|
-
var _badge = _interopRequireDefault(require("../src/badge.vue"));
|
|
5
|
-
var _ssr = require("../../__tests__/utils/ssr.cjs");
|
|
6
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
-
(0, _vitest.describe)("YhBadge SSR", () => {
|
|
8
|
-
(0, _vitest.it)("should render correctly in SSR", async () => {
|
|
9
|
-
const html = await (0, _ssr.renderSSR)(_badge.default, {
|
|
10
|
-
value: 12,
|
|
11
|
-
type: "primary"
|
|
12
|
-
});
|
|
13
|
-
(0, _ssr.expectSSRHasClass)(html, "yh-badge");
|
|
14
|
-
(0, _vitest.expect)(html).toContain("12");
|
|
15
|
-
});
|
|
16
|
-
(0, _vitest.it)("should render dot mode in SSR", async () => {
|
|
17
|
-
const html = await (0, _ssr.renderSSR)(_badge.default, {
|
|
18
|
-
isDot: true
|
|
19
|
-
});
|
|
20
|
-
(0, _ssr.expectSSRHasClass)(html, "is-dot");
|
|
21
|
-
});
|
|
22
|
-
(0, _vitest.it)("should render max value in SSR", async () => {
|
|
23
|
-
const html = await (0, _ssr.renderSSR)(_badge.default, {
|
|
24
|
-
value: 100,
|
|
25
|
-
max: 99
|
|
26
|
-
});
|
|
27
|
-
(0, _vitest.expect)(html).toContain("99+");
|
|
28
|
-
});
|
|
29
|
-
(0, _vitest.it)("should hydrate without mismatch", async () => {
|
|
30
|
-
const result = await (0, _ssr.testHydration)(_badge.default, {
|
|
31
|
-
value: "new",
|
|
32
|
-
type: "danger"
|
|
33
|
-
});
|
|
34
|
-
(0, _vitest.expect)(result.isMatch).toBe(true);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import Badge from "../src/badge.vue";
|
|
3
|
-
import { renderSSR, expectSSRHasClass, testHydration } from "../../__tests__/utils/ssr.mjs";
|
|
4
|
-
describe("YhBadge SSR", () => {
|
|
5
|
-
it("should render correctly in SSR", async () => {
|
|
6
|
-
const html = await renderSSR(Badge, {
|
|
7
|
-
value: 12,
|
|
8
|
-
type: "primary"
|
|
9
|
-
});
|
|
10
|
-
expectSSRHasClass(html, "yh-badge");
|
|
11
|
-
expect(html).toContain("12");
|
|
12
|
-
});
|
|
13
|
-
it("should render dot mode in SSR", async () => {
|
|
14
|
-
const html = await renderSSR(Badge, {
|
|
15
|
-
isDot: true
|
|
16
|
-
});
|
|
17
|
-
expectSSRHasClass(html, "is-dot");
|
|
18
|
-
});
|
|
19
|
-
it("should render max value in SSR", async () => {
|
|
20
|
-
const html = await renderSSR(Badge, {
|
|
21
|
-
value: 100,
|
|
22
|
-
max: 99
|
|
23
|
-
});
|
|
24
|
-
expect(html).toContain("99+");
|
|
25
|
-
});
|
|
26
|
-
it("should hydrate without mismatch", async () => {
|
|
27
|
-
const result = await testHydration(Badge, {
|
|
28
|
-
value: "new",
|
|
29
|
-
type: "danger"
|
|
30
|
-
});
|
|
31
|
-
expect(result.isMatch).toBe(true);
|
|
32
|
-
});
|
|
33
|
-
});
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _vitest = require("vitest");
|
|
4
|
-
var _testUtils = require("@vue/test-utils");
|
|
5
|
-
var _badge = _interopRequireDefault(require("../src/badge.vue"));
|
|
6
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
-
(0, _vitest.describe)("Badge \u7EC4\u4EF6", () => {
|
|
8
|
-
(0, _vitest.it)("\u5E94\u8BE5\u6B63\u786E\u6E32\u67D3", () => {
|
|
9
|
-
const wrapper = (0, _testUtils.mount)(_badge.default, {
|
|
10
|
-
props: {
|
|
11
|
-
value: 12
|
|
12
|
-
},
|
|
13
|
-
slots: {
|
|
14
|
-
default: "<button>\u6309\u94AE</button>"
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
(0, _vitest.expect)(wrapper.find(".yh-badge").exists()).toBe(true);
|
|
18
|
-
(0, _vitest.expect)(wrapper.find(".yh-badge__content").text()).toBe("12");
|
|
19
|
-
});
|
|
20
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301\u6700\u5927\u503C\u9650\u5236", () => {
|
|
21
|
-
const wrapper = (0, _testUtils.mount)(_badge.default, {
|
|
22
|
-
props: {
|
|
23
|
-
value: 200,
|
|
24
|
-
max: 99
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
(0, _vitest.expect)(wrapper.find(".yh-badge__content").text()).toBe("99+");
|
|
28
|
-
});
|
|
29
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301\u5C0F\u7EA2\u70B9\u6A21\u5F0F", () => {
|
|
30
|
-
const wrapper = (0, _testUtils.mount)(_badge.default, {
|
|
31
|
-
props: {
|
|
32
|
-
isDot: true
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
(0, _vitest.expect)(wrapper.find(".yh-badge__content").classes()).toContain("is-dot");
|
|
36
|
-
});
|
|
37
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301\u9690\u85CF\u5FBD\u6807", () => {
|
|
38
|
-
const wrapper = (0, _testUtils.mount)(_badge.default, {
|
|
39
|
-
props: {
|
|
40
|
-
value: 12,
|
|
41
|
-
hidden: true
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
(0, _vitest.expect)(wrapper.find(".yh-badge__content").exists()).toBe(false);
|
|
45
|
-
});
|
|
46
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301\u4E0D\u540C\u7C7B\u578B", () => {
|
|
47
|
-
const wrapper = (0, _testUtils.mount)(_badge.default, {
|
|
48
|
-
props: {
|
|
49
|
-
value: 12,
|
|
50
|
-
type: "success"
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
(0, _vitest.expect)(wrapper.find(".yh-badge__content").classes()).toContain("yh-badge__content--success");
|
|
54
|
-
});
|
|
55
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301\u81EA\u5B9A\u4E49\u989C\u8272", () => {
|
|
56
|
-
const wrapper = (0, _testUtils.mount)(_badge.default, {
|
|
57
|
-
props: {
|
|
58
|
-
value: 12,
|
|
59
|
-
color: "#ff0000"
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
const content = wrapper.find(".yh-badge__content");
|
|
63
|
-
const style = content.attributes("style");
|
|
64
|
-
(0, _vitest.expect)(style).toMatch(/background-color:\s*(#ff0000|rgb\(255, 0, 0\))/i);
|
|
65
|
-
});
|
|
66
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301\u504F\u79FB\u8BBE\u7F6E", () => {
|
|
67
|
-
const wrapper = (0, _testUtils.mount)(_badge.default, {
|
|
68
|
-
props: {
|
|
69
|
-
value: 12,
|
|
70
|
-
offset: [10, 10]
|
|
71
|
-
},
|
|
72
|
-
slots: {
|
|
73
|
-
default: "<button>\u6309\u94AE</button>"
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
const content = wrapper.find(".yh-badge__content");
|
|
77
|
-
(0, _vitest.expect)(content.attributes("style")).toContain("transform");
|
|
78
|
-
});
|
|
79
|
-
(0, _vitest.it)("\u5F53\u503C\u4E3A0\u4E14showZero\u4E3Afalse\u65F6\u4E0D\u663E\u793A", () => {
|
|
80
|
-
const wrapper = (0, _testUtils.mount)(_badge.default, {
|
|
81
|
-
props: {
|
|
82
|
-
value: 0,
|
|
83
|
-
showZero: false
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
(0, _vitest.expect)(wrapper.find(".yh-badge__content").exists()).toBe(false);
|
|
87
|
-
});
|
|
88
|
-
(0, _vitest.it)("\u5F53\u503C\u4E3A0\u4E14showZero\u4E3Atrue\u65F6\u663E\u793A", () => {
|
|
89
|
-
const wrapper = (0, _testUtils.mount)(_badge.default, {
|
|
90
|
-
props: {
|
|
91
|
-
value: 0,
|
|
92
|
-
showZero: true
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
(0, _vitest.expect)(wrapper.find(".yh-badge__content").text()).toBe("0");
|
|
96
|
-
});
|
|
97
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301\u81EA\u5B9A\u4E49\u5185\u5BB9\u63D2\u69FD", () => {
|
|
98
|
-
const wrapper = (0, _testUtils.mount)(_badge.default, {
|
|
99
|
-
slots: {
|
|
100
|
-
content: '<span class="custom-content">Custom</span>'
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
(0, _vitest.expect)(wrapper.find(".custom-content").exists()).toBe(true);
|
|
104
|
-
(0, _vitest.expect)(wrapper.find(".custom-content").text()).toBe("Custom");
|
|
105
|
-
});
|
|
106
|
-
(0, _vitest.it)("\u5E94\u8BE5\u652F\u6301\u65E0\u8FB9\u6846\u6A21\u5F0F", () => {
|
|
107
|
-
const wrapper = (0, _testUtils.mount)(_badge.default, {
|
|
108
|
-
props: {
|
|
109
|
-
value: 12,
|
|
110
|
-
showBorder: false
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
(0, _vitest.expect)(wrapper.find(".yh-badge__content").classes()).toContain("is-no-border");
|
|
114
|
-
});
|
|
115
|
-
});
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { mount } from "@vue/test-utils";
|
|
3
|
-
import Badge from "../src/badge.vue";
|
|
4
|
-
describe("Badge \u7EC4\u4EF6", () => {
|
|
5
|
-
it("\u5E94\u8BE5\u6B63\u786E\u6E32\u67D3", () => {
|
|
6
|
-
const wrapper = mount(Badge, {
|
|
7
|
-
props: {
|
|
8
|
-
value: 12
|
|
9
|
-
},
|
|
10
|
-
slots: {
|
|
11
|
-
default: "<button>\u6309\u94AE</button>"
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
expect(wrapper.find(".yh-badge").exists()).toBe(true);
|
|
15
|
-
expect(wrapper.find(".yh-badge__content").text()).toBe("12");
|
|
16
|
-
});
|
|
17
|
-
it("\u5E94\u8BE5\u652F\u6301\u6700\u5927\u503C\u9650\u5236", () => {
|
|
18
|
-
const wrapper = mount(Badge, {
|
|
19
|
-
props: {
|
|
20
|
-
value: 200,
|
|
21
|
-
max: 99
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
expect(wrapper.find(".yh-badge__content").text()).toBe("99+");
|
|
25
|
-
});
|
|
26
|
-
it("\u5E94\u8BE5\u652F\u6301\u5C0F\u7EA2\u70B9\u6A21\u5F0F", () => {
|
|
27
|
-
const wrapper = mount(Badge, {
|
|
28
|
-
props: {
|
|
29
|
-
isDot: true
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
expect(wrapper.find(".yh-badge__content").classes()).toContain("is-dot");
|
|
33
|
-
});
|
|
34
|
-
it("\u5E94\u8BE5\u652F\u6301\u9690\u85CF\u5FBD\u6807", () => {
|
|
35
|
-
const wrapper = mount(Badge, {
|
|
36
|
-
props: {
|
|
37
|
-
value: 12,
|
|
38
|
-
hidden: true
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
expect(wrapper.find(".yh-badge__content").exists()).toBe(false);
|
|
42
|
-
});
|
|
43
|
-
it("\u5E94\u8BE5\u652F\u6301\u4E0D\u540C\u7C7B\u578B", () => {
|
|
44
|
-
const wrapper = mount(Badge, {
|
|
45
|
-
props: {
|
|
46
|
-
value: 12,
|
|
47
|
-
type: "success"
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
expect(wrapper.find(".yh-badge__content").classes()).toContain("yh-badge__content--success");
|
|
51
|
-
});
|
|
52
|
-
it("\u5E94\u8BE5\u652F\u6301\u81EA\u5B9A\u4E49\u989C\u8272", () => {
|
|
53
|
-
const wrapper = mount(Badge, {
|
|
54
|
-
props: {
|
|
55
|
-
value: 12,
|
|
56
|
-
color: "#ff0000"
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
const content = wrapper.find(".yh-badge__content");
|
|
60
|
-
const style = content.attributes("style");
|
|
61
|
-
expect(style).toMatch(/background-color:\s*(#ff0000|rgb\(255, 0, 0\))/i);
|
|
62
|
-
});
|
|
63
|
-
it("\u5E94\u8BE5\u652F\u6301\u504F\u79FB\u8BBE\u7F6E", () => {
|
|
64
|
-
const wrapper = mount(Badge, {
|
|
65
|
-
props: {
|
|
66
|
-
value: 12,
|
|
67
|
-
offset: [10, 10]
|
|
68
|
-
},
|
|
69
|
-
slots: {
|
|
70
|
-
default: "<button>\u6309\u94AE</button>"
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
const content = wrapper.find(".yh-badge__content");
|
|
74
|
-
expect(content.attributes("style")).toContain("transform");
|
|
75
|
-
});
|
|
76
|
-
it("\u5F53\u503C\u4E3A0\u4E14showZero\u4E3Afalse\u65F6\u4E0D\u663E\u793A", () => {
|
|
77
|
-
const wrapper = mount(Badge, {
|
|
78
|
-
props: {
|
|
79
|
-
value: 0,
|
|
80
|
-
showZero: false
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
expect(wrapper.find(".yh-badge__content").exists()).toBe(false);
|
|
84
|
-
});
|
|
85
|
-
it("\u5F53\u503C\u4E3A0\u4E14showZero\u4E3Atrue\u65F6\u663E\u793A", () => {
|
|
86
|
-
const wrapper = mount(Badge, {
|
|
87
|
-
props: {
|
|
88
|
-
value: 0,
|
|
89
|
-
showZero: true
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
expect(wrapper.find(".yh-badge__content").text()).toBe("0");
|
|
93
|
-
});
|
|
94
|
-
it("\u5E94\u8BE5\u652F\u6301\u81EA\u5B9A\u4E49\u5185\u5BB9\u63D2\u69FD", () => {
|
|
95
|
-
const wrapper = mount(Badge, {
|
|
96
|
-
slots: {
|
|
97
|
-
content: '<span class="custom-content">Custom</span>'
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
expect(wrapper.find(".custom-content").exists()).toBe(true);
|
|
101
|
-
expect(wrapper.find(".custom-content").text()).toBe("Custom");
|
|
102
|
-
});
|
|
103
|
-
it("\u5E94\u8BE5\u652F\u6301\u65E0\u8FB9\u6846\u6A21\u5F0F", () => {
|
|
104
|
-
const wrapper = mount(Badge, {
|
|
105
|
-
props: {
|
|
106
|
-
value: 12,
|
|
107
|
-
showBorder: false
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
expect(wrapper.find(".yh-badge__content").classes()).toContain("is-no-border");
|
|
111
|
-
});
|
|
112
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _vitest = require("vitest");
|
|
4
|
-
var _serverRenderer = require("@vue/server-renderer");
|
|
5
|
-
var _vue = require("vue");
|
|
6
|
-
var _breadcrumb = _interopRequireDefault(require("../src/breadcrumb.vue"));
|
|
7
|
-
var _breadcrumbItem = _interopRequireDefault(require("../src/breadcrumb-item.vue"));
|
|
8
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
(0, _vitest.describe)("YhBreadcrumb SSR", () => {
|
|
10
|
-
(0, _vitest.it)("should render to string on server", async () => {
|
|
11
|
-
const html = await (0, _serverRenderer.renderToString)((0, _vue.h)(_breadcrumb.default, null, {
|
|
12
|
-
default: () => [(0, _vue.h)(_breadcrumbItem.default, null, {
|
|
13
|
-
default: () => "Home"
|
|
14
|
-
}), (0, _vue.h)(_breadcrumbItem.default, null, {
|
|
15
|
-
default: () => "Components"
|
|
16
|
-
})]
|
|
17
|
-
}));
|
|
18
|
-
(0, _vitest.expect)(html).toContain("yh-breadcrumb");
|
|
19
|
-
(0, _vitest.expect)(html).toContain("Home");
|
|
20
|
-
(0, _vitest.expect)(html).toContain("yh-breadcrumb-item__separator");
|
|
21
|
-
});
|
|
22
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { renderToString } from "@vue/server-renderer";
|
|
3
|
-
import { h } from "vue";
|
|
4
|
-
import Breadcrumb from "../src/breadcrumb.vue";
|
|
5
|
-
import BreadcrumbItem from "../src/breadcrumb-item.vue";
|
|
6
|
-
describe("YhBreadcrumb SSR", () => {
|
|
7
|
-
it("should render to string on server", async () => {
|
|
8
|
-
const html = await renderToString(
|
|
9
|
-
h(Breadcrumb, null, {
|
|
10
|
-
default: () => [
|
|
11
|
-
h(BreadcrumbItem, null, { default: () => "Home" }),
|
|
12
|
-
h(BreadcrumbItem, null, { default: () => "Components" })
|
|
13
|
-
]
|
|
14
|
-
})
|
|
15
|
-
);
|
|
16
|
-
expect(html).toContain("yh-breadcrumb");
|
|
17
|
-
expect(html).toContain("Home");
|
|
18
|
-
expect(html).toContain("yh-breadcrumb-item__separator");
|
|
19
|
-
});
|
|
20
|
-
});
|