@webitel/ui-sdk 26.8.75 → 26.8.77
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/dist/{clients-BmeOR90W.js → clients-B8-WDK4d.js} +66 -79
- package/dist/{components-C-ri6OSQ.js → components-fKLMXHe_.js} +11 -11
- package/dist/{enums-BvonmHq2.js → enums-B_9ZBu01.js} +2 -2
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +3 -3
- package/dist/ui-sdk.umd.cjs +610 -612
- package/dist/{useValidation-0JwQGpLM.js → useValidation-CEed9cxY.js} +1 -1
- package/dist/{utils-CzBdLnFt.js → utils-BZHq8qMH.js} +1 -1
- package/dist/wt-action-bar-D74sgDCk.js +94 -0
- package/dist/{wt-button-D-nFhi1f.js → wt-button-BwPz__rU.js} +2 -2
- package/dist/{wt-chat-emoji-CLhgb02d.js → wt-chat-emoji-DcVCe4jW.js} +4 -4
- package/dist/{wt-datepicker-DCa23hYx.js → wt-datepicker-BgjjbOMX.js} +2 -2
- package/dist/{wt-display-chip-items-B7QLz9QM.js → wt-display-chip-items-D-v25BUi.js} +2 -2
- package/dist/{wt-dual-panel-D-LChluY.js → wt-dual-panel-Cs_Yzfxt.js} +1 -1
- package/dist/{wt-expansion-card-CToBA1fy.js → wt-expansion-card-BT586Mul.js} +1 -1
- package/dist/{wt-expansion-panel-af2t3VrM.js → wt-expansion-panel-kZmHSvPU.js} +1 -1
- package/dist/{wt-icon-action-DYBTs3Mf.js → wt-icon-action-DJzm0kEk.js} +1 -1
- package/dist/{wt-icon-btn-BfhuUt8-.js → wt-icon-btn-BzraLc-w.js} +1 -1
- package/dist/{wt-icon-WyFAGc4t.js → wt-icon-iRDqWkjp.js} +19 -19
- package/dist/{wt-notifications-bar-CvKwuTEg.js → wt-notifications-bar-ZIMKBDqL.js} +2 -2
- package/dist/{wt-player-B2etfN5v.js → wt-player-CFrKSilF.js} +3 -3
- package/dist/{wt-screen-recordings-action-CepB2pqh.js → wt-screen-recordings-action-CVHZAWjl.js} +1 -1
- package/dist/{wt-search-bar-B4YkhgIB.js → wt-search-bar-DosqJLXT.js} +1 -1
- package/dist/{wt-send-message-popup-BhZ7K_Vs.js → wt-send-message-popup-BpgjqxvU.js} +2 -2
- package/dist/{wt-status-select-ELI7j73g.js → wt-status-select-Dnv9tj7o.js} +1 -1
- package/dist/{wt-timepicker-C3v9Cp2e.js → wt-timepicker-B4MOaSEZ.js} +2 -2
- package/dist/{wt-toast-DxQBRGm2.js → wt-toast-BcgNZFCD.js} +2 -2
- package/dist/{wt-tree-table-C5sxm-Eb.js → wt-tree-table-xXbBeLUc.js} +1 -1
- package/dist/{wt-type-extension-value-input-gQGgxMcJ.js → wt-type-extension-value-input-D86gV8RI.js} +3 -3
- package/dist/{wt-vidstack-player-B37Mdf0u.js → wt-vidstack-player-BzyyVEji.js} +4 -4
- package/package.json +1 -1
- package/src/assets/icons/sprite/call--filled.svg +1 -1
- package/src/assets/icons/sprite/call-add-to--filled.svg +2 -2
- package/src/assets/icons/sprite/call-add-to.svg +2 -3
- package/src/assets/icons/sprite/call-disconnect--filled.svg +2 -2
- package/src/assets/icons/sprite/call-disconnect.svg +2 -2
- package/src/assets/icons/sprite/call-end--filled.svg +2 -1
- package/src/assets/icons/sprite/call-end.svg +2 -2
- package/src/assets/icons/sprite/call-inbound--filled.svg +2 -3
- package/src/assets/icons/sprite/call-inbound.svg +2 -2
- package/src/assets/icons/sprite/call-missed--filled.svg +2 -2
- package/src/assets/icons/sprite/call-missed.svg +2 -2
- package/src/assets/icons/sprite/call-outbound--filled.svg +2 -2
- package/src/assets/icons/sprite/call-outbound.svg +2 -2
- package/src/assets/icons/sprite/call-ringing--filled.svg +3 -4
- package/src/assets/icons/sprite/call-ringing.svg +3 -2
- package/src/assets/icons/sprite/call-transfer--filled.svg +2 -2
- package/src/assets/icons/sprite/call-transfer.svg +2 -2
- package/src/assets/icons/sprite/call.svg +1 -2
- package/src/components/transitions/__tests__/ExpandTransition.spec.js +15 -0
- package/src/components/transitions/__tests__/WtReplaceTransition.spec.js +66 -0
- package/src/components/transitions/__tests__/WtTransition.spec.js +35 -0
- package/src/components/wt-action-bar/WtActionBarActionsOrder.js +1 -1
- package/src/components/wt-action-bar/__tests__/WtActionBar.spec.js +121 -0
- package/src/components/wt-action-bar/wt-action-bar.vue +57 -33
- package/src/components/wt-app-header/__tests__/WtAppNavigator.spec.js +65 -4
- package/src/components/wt-app-header/__tests__/WtHeaderActions.spec.js +81 -2
- package/src/components/wt-avatar/__tests__/WtAvatar.spec.js +111 -0
- package/src/components/wt-badge/__tests__/WtBadge.spec.js +80 -0
- package/src/components/wt-badge-new/__tests__/WtBadge.spec.js +61 -0
- package/src/components/wt-breadcrumb/__tests__/WtBreadcrumb.spec.js +117 -0
- package/src/components/wt-button-select/__tests__/WtButtonSelect.spec.js +37 -5
- package/src/components/wt-call-media-metric/__tests__/WtCallMediaMetric.spec.js +84 -0
- package/src/components/wt-card/__tests__/WtCard.spec.js +20 -0
- package/src/components/wt-checkbox/__tests__/WtCheckbox.spec.js +63 -0
- package/src/components/wt-chip/__tests__/WtChip.spec.js +32 -0
- package/src/components/wt-confirm-dialog/__tests__/WtConfirmDialog.spec.js +92 -0
- package/src/components/wt-context-menu/__tests__/WtContextMenu.spec.js +146 -1
- package/src/components/wt-copy-action/__tests__/WtCopyAction.spec.js +57 -0
- package/src/components/wt-datepicker/__tests__/WtDatepicker.spec.js +53 -0
- package/src/components/wt-datetime-text/__tests__/WtDatetimeText.spec.js +49 -0
- package/src/components/wt-divider/__tests__/WtDivider.spec.js +30 -0
- package/src/components/wt-dual-panel/__tests__/WtDualPanel.spec.js +120 -0
- package/src/components/wt-dummy/__tests__/WtDummy.spec.js +63 -1
- package/src/components/wt-empty/__tests__/WtEmpty.spec.js +84 -0
- package/src/components/wt-error-page/__tests__/WtErrorPage.spec.js +60 -0
- package/src/components/wt-expansion-card/__tests__/WtExpansionCard.spec.js +63 -0
- package/src/components/wt-expansion-panel/__tests__/WtExpansionPanel.spec.js +48 -9
- package/src/components/wt-filters-panel-wrapper/__tests__/WtFiltersPanelWrapper.spec.js +81 -10
- package/src/components/wt-hint/__tests__/WtHint.spec.js +44 -1
- package/src/components/wt-icon/__tests__/WtIcon.spec.js +29 -0
- package/src/components/wt-icon-action/__tests__/WtIconAction.spec.js +79 -0
- package/src/components/wt-icon-action/wt-icon-action.vue +1 -1
- package/src/components/wt-icon-btn/__tests__/WtIconBtn.spec.js +46 -0
- package/src/components/wt-image/__tests__/WtImage.spec.js +83 -0
- package/src/components/wt-indicator/__tests__/WtIndicator.spec.js +23 -0
- package/src/components/wt-input-number/__tests__/WtInputNumber.spec.js +77 -0
- package/src/components/wt-input-text/__tests__/WtInputText.spec.js +85 -0
- package/src/components/wt-intersection-observer/__tests__/WtIntersectionObserver.spec.js +24 -3
- package/src/components/wt-item-link/__tests__/WtItemLink.spec.js +93 -1
- package/src/components/wt-label/__tests__/WtLabel.spec.js +49 -1
- package/src/components/wt-load-bar/__tests__/WtLoadBar.spec.js +49 -0
- package/src/components/wt-loader/__tests__/WtLoader.spec.js +26 -1
- package/src/components/wt-logo/__tests__/WtLogo.spec.js +55 -0
- package/src/components/wt-menubar/__tests__/WtMenubar.spec.js +30 -0
- package/src/components/wt-message/__tests__/WtMessage.spec.js +46 -0
- package/src/components/wt-multi-select/__tests__/WtMultiSelect.spec.js +106 -0
- package/src/components/wt-page-header/__tests__/WtPageHeader.spec.js +111 -0
- package/src/components/wt-password/__tests__/WtPassword.spec.js +107 -0
- package/src/components/wt-popover/__tests__/WtPopover.spec.js +73 -0
- package/src/components/wt-progress-bar/__tests__/WtProgressBar.spec.js +34 -0
- package/src/components/wt-radio/__tests__/WtRadio.spec.js +45 -0
- package/src/components/wt-rounded-action/__tests__/WtRoundedAction.spec.js +48 -0
- package/src/components/wt-search-bar/__tests__/WtSearchBar.spec.js +74 -13
- package/src/components/wt-single-select/__tests__/WtSingleSelect.spec.js +117 -0
- package/src/components/wt-slider/__tests__/WtSlider.spec.js +100 -0
- package/src/components/wt-stepper/__tests__/WtStepper.spec.js +105 -0
- package/src/components/wt-switcher/__tests__/WtSwitcher.spec.js +47 -0
- package/src/components/wt-table/__tests__/WtTable.spec.js +237 -0
- package/src/components/wt-table-actions/__tests__/WtTableActions.spec.js +153 -1
- package/src/components/wt-table-column-select/__tests__/WtTableColumnSelect.spec.js +147 -0
- package/src/components/wt-tabs/__tests__/WtTabs.spec.js +55 -0
- package/src/components/wt-textarea/__tests__/WtTextarea.spec.js +49 -0
- package/src/components/wt-time-input/__tests__/WtTimeInput.spec.js +29 -0
- package/src/components/wt-tree/__tests__/WtTree.spec.js +126 -2
- package/src/components/wt-tree-line/__tests__/WtTreeLine.spec.js +205 -0
- package/src/components/wt-tree-table/__tests__/WtTreeTable.spec.js +155 -0
- package/src/components/wt-tree-table-row/__tests__/WtTreeTableRow.spec.js +176 -0
- package/src/components/wt-vidstack-player/__tests__/WtVidstackPlayer.spec.js +82 -0
- package/src/enums/IconAction/{IconAction.enum.js → IconAction.ts} +4 -2
- package/src/enums/index.ts +1 -1
- package/src/modules/ObjectPermissions/components/_internal/permissions-tab-content.vue +1 -1
- package/types/.tsbuildinfo +1 -1
- package/types/components/wt-action-bar/wt-action-bar.vue.d.ts +349 -105
- package/types/components/wt-datetime-text/__tests__/WtDatetimeText.spec.d.ts +1 -0
- package/types/components/wt-divider/__tests__/WtDivider.spec.d.ts +1 -0
- package/types/components/wt-dual-panel/__tests__/WtDualPanel.spec.d.ts +1 -0
- package/types/components/wt-empty/__tests__/WtEmpty.spec.d.ts +1 -0
- package/types/components/wt-error-page/__tests__/WtErrorPage.spec.d.ts +1 -0
- package/types/components/wt-expansion-card/__tests__/WtExpansionCard.spec.d.ts +1 -0
- package/types/components/wt-image/__tests__/WtImage.spec.d.ts +1 -0
- package/types/components/wt-input-number/__tests__/WtInputNumber.spec.d.ts +1 -0
- package/types/components/wt-input-text/__tests__/WtInputText.spec.d.ts +1 -0
- package/types/components/wt-logo/__tests__/WtLogo.spec.d.ts +1 -0
- package/types/components/wt-menubar/__tests__/WtMenubar.spec.d.ts +1 -0
- package/types/components/wt-message/__tests__/WtMessage.spec.d.ts +1 -0
- package/types/components/wt-multi-select/__tests__/WtMultiSelect.spec.d.ts +1 -0
- package/types/components/wt-page-header/__tests__/WtPageHeader.spec.d.ts +1 -0
- package/types/components/wt-password/__tests__/WtPassword.spec.d.ts +1 -0
- package/types/components/wt-popover/__tests__/WtPopover.spec.d.ts +1 -0
- package/types/components/wt-single-select/__tests__/WtSingleSelect.spec.d.ts +1 -0
- package/types/components/wt-slider/__tests__/WtSlider.spec.d.ts +1 -0
- package/types/components/wt-stepper/__tests__/WtStepper.spec.d.ts +1 -0
- package/types/components/wt-table/__tests__/WtTable.spec.d.ts +1 -0
- package/types/components/wt-tree-line/__tests__/WtTreeLine.spec.d.ts +1 -0
- package/types/components/wt-tree-table/__tests__/WtTreeTable.spec.d.ts +1 -0
- package/types/components/wt-tree-table-row/__tests__/WtTreeTableRow.spec.d.ts +1 -0
- package/types/components/wt-vidstack-player/__tests__/WtVidstackPlayer.spec.d.ts +1 -0
- package/types/enums/IconAction/IconAction.d.ts +31 -0
- package/types/enums/index.d.ts +1 -1
- package/dist/wt-action-bar-D4wDtBqb.js +0 -87
- package/src/components/wt-action-bar/__tests__/wt-action-bar.spec.js +0 -10
- package/src/components/wt-avatar/__tests__/wt-avatar.spec.js +0 -10
- package/src/components/wt-badge/__tests__/wt-badge.spec.js +0 -10
- package/src/components/wt-breadcrumb/__tests__/wt-breadcrumb.spec.js +0 -14
- package/src/components/wt-dual-panel/__tests__/WtDualPanel.js +0 -62
- package/src/components/wt-empty/__tests__/wt-empty.spec.js +0 -10
- package/src/components/wt-error-page/__tests__/wt-error-page.spec.js +0 -30
- package/src/components/wt-image/__tests__/wt-image.spec.js +0 -10
- package/src/components/wt-logo/__tests__/wt-logo.spec.js +0 -10
- package/src/components/wt-page-header/__tests__/wt-page-header.spec.js +0 -10
- package/src/components/wt-stepper/__tests__/WtStepper.spec.vue.js +0 -19
- package/types/enums/IconAction/IconAction.enum.d.ts +0 -30
- /package/types/components/{wt-action-bar/__tests__/wt-action-bar.spec.d.ts → transitions/__tests__/WtReplaceTransition.spec.d.ts} +0 -0
- /package/types/components/{wt-avatar/__tests__/wt-avatar.spec.d.ts → transitions/__tests__/WtTransition.spec.d.ts} +0 -0
- /package/types/components/{wt-badge/__tests__/wt-badge.spec.d.ts → wt-action-bar/__tests__/WtActionBar.spec.d.ts} +0 -0
- /package/types/components/{wt-breadcrumb/__tests__/wt-breadcrumb.spec.d.ts → wt-avatar/__tests__/WtAvatar.spec.d.ts} +0 -0
- /package/types/components/{wt-empty/__tests__/wt-empty.spec.d.ts → wt-badge/__tests__/WtBadge.spec.d.ts} +0 -0
- /package/types/components/{wt-dual-panel/__tests__/WtDualPanel.d.ts → wt-badge-new/__tests__/WtBadge.spec.d.ts} +0 -0
- /package/types/components/{wt-error-page/__tests__/wt-error-page.spec.d.ts → wt-breadcrumb/__tests__/WtBreadcrumb.spec.d.ts} +0 -0
- /package/types/components/{wt-image/__tests__/wt-image.spec.d.ts → wt-call-media-metric/__tests__/WtCallMediaMetric.spec.d.ts} +0 -0
- /package/types/components/{wt-logo/__tests__/wt-logo.spec.d.ts → wt-card/__tests__/WtCard.spec.d.ts} +0 -0
- /package/types/components/{wt-page-header/__tests__/wt-page-header.spec.d.ts → wt-confirm-dialog/__tests__/WtConfirmDialog.spec.d.ts} +0 -0
- /package/types/components/{wt-stepper/__tests__/WtStepper.spec.vue.d.ts → wt-copy-action/__tests__/WtCopyAction.spec.d.ts} +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path
|
|
3
|
-
d="M4.12302 3.10133C5.60827 1.63289 7.91438 1.63289 9.39964 3.10133L10.6027 4.29076C11.2259 4.9069 11.5869 5.73865 11.5575 6.63726C11.5284 7.52905 11.1223 8.33214 10.5024 8.94495L10.1724 9.27129C10.5972 10.1021 11.2447 10.9718 12.1065 11.8238C12.8562 12.5651 13.7961 13.2183 14.7373 13.7196L15.151 13.3106C16.4357 12.0404 18.4411 12.0404 19.7258 13.3106L20.9289 14.5001C20.9565 14.5273 20.9832 14.5555 21.0089 14.5846C21.6712 15.333 21.9552 16.2553 21.9954 17.0906C22.0353 17.9188 21.8437 18.8023 21.3775 19.5396C21.3067 19.6516 21.2235 19.7551 21.1294 19.8481L20.4276 20.5419C19.2103 21.7455 17.6267 22.2099 15.9741 21.9128L15.9567 21.9097C12.9525 21.3385 9.7479 19.5567 7.14329 16.9861C4.41754 14.3941 2.73098 11.2318 2.14584 8.298C1.69091 6.54212 2.35115 4.85314 3.42124 3.79517L4.12302 3.10133ZM7.9935 4.52357C7.28741 3.82548 6.23525 3.82548 5.52916 4.52357L4.82738 5.21741C4.18471 5.85279 3.82621 6.83916 4.08694 7.81548C4.09266 7.83692 4.09767 7.85854 4.10196 7.88032C4.59644 10.3918 6.06806 13.2061 8.52787 15.5428L8.54193 15.5565C10.9164 17.9022 13.7769 19.4581 16.3254 19.9439L16.3279 19.9444C17.3568 20.1293 18.279 19.8537 19.0215 19.1197L19.7019 18.447C19.9107 18.104 20.02 17.6492 19.9978 17.1868C19.9752 16.7174 19.818 16.2601 19.5166 15.9162L18.3197 14.7329C17.8141 14.233 17.0627 14.233 16.5571 14.7329L15.6549 15.6249C15.5539 15.7248 15.4416 15.7973 15.3302 15.8463C15.0674 15.9619 14.7675 15.959 14.5069 15.8383C13.2047 15.2347 11.8074 14.3406 10.7004 13.2461C9.48869 12.0481 8.56777 10.7419 8.04775 9.4224C7.96653 9.2163 7.95604 8.98907 8.01793 8.77636C8.06828 8.60332 8.16411 8.44433 8.29426 8.31566L9.0963 7.52271C9.40888 7.21366 9.54863 6.8778 9.5586 6.57204C9.56854 6.26744 9.45095 5.96452 9.19655 5.713L7.9935 4.52357Z"/>
|
|
2
|
+
<path d="M6.30249 2.01553C6.68416 2.06455 7.04671 2.2239 7.34644 2.46963L7.49194 2.59951L7.49878 2.60732L10.0994 5.29971C10.4621 5.6659 10.6785 6.15519 10.6941 6.66689C10.7097 7.18146 10.5196 7.67751 10.158 8.04092L10.1589 8.04189C10.0499 8.15217 9.7815 8.47237 9.54077 8.81631L9.37573 9.06436C9.32602 9.14388 9.28241 9.21956 9.24683 9.28799C9.21139 9.3562 9.18861 9.40996 9.17554 9.44814C9.17172 9.45931 9.16819 9.46714 9.16675 9.47256C9.17905 9.73281 9.29259 9.99233 9.48999 10.1923L13.7898 14.4862L13.8699 14.5575C14.0104 14.6727 14.1735 14.7506 14.3425 14.787L14.5134 14.8095C14.5189 14.8081 14.5274 14.8055 14.5388 14.8017C14.5772 14.7885 14.6317 14.7658 14.7 14.7304C14.837 14.6592 15.002 14.5556 15.1726 14.4364C15.517 14.1959 15.8375 13.9272 15.948 13.8183C16.3119 13.4576 16.8089 13.2688 17.323 13.2841C17.8372 13.2997 18.3307 13.5177 18.698 13.8827L21.3972 16.5614L21.4001 16.5644C21.72 16.8873 21.9277 17.3058 21.9851 17.7509L21.9998 17.9433L21.9959 18.1366L21.9773 18.3026C21.917 18.6876 21.7403 19.0466 21.4626 19.3271L21.4617 19.329L20.1257 20.661L19.9773 20.8026C19.2214 21.4911 18.2508 21.9064 17.2097 21.9862L17.0017 21.997C15.9605 22.0318 14.918 21.7315 14.0271 21.1435L14.0193 21.1386C9.9189 18.3161 6.32343 14.8049 3.40503 10.7792L2.82984 9.96768L2.82593 9.96084L2.82202 9.95498C2.24305 9.05651 1.9554 8.0097 2.00562 6.96865L2.02027 6.76064C2.1222 5.65083 2.60645 4.62709 3.39527 3.86514L4.7273 2.53604C5.09344 2.17517 5.59268 1.98538 6.11011 2.00088L6.30249 2.01553ZM4.80835 5.28115C4.80069 5.2888 4.7927 5.29609 4.78491 5.30361C4.34863 5.72504 4.07064 6.29971 4.01148 6.94326C3.95245 7.5865 4.11626 8.266 4.49683 8.86123C7.36533 13.0067 10.9756 16.6103 15.1287 19.4735L15.3552 19.6112C15.8159 19.8645 16.3187 19.9951 16.8113 19.9999L17.0574 19.9911C17.7047 19.9413 18.2849 19.6726 18.7136 19.245L19.9832 17.9774C19.9824 17.9766 19.982 17.9754 19.9812 17.9745L17.2888 15.3026L17.2878 15.3017V15.3007C17.061 15.5131 16.6855 15.8194 16.3181 16.0761C16.1086 16.2224 15.8651 16.3795 15.6218 16.5058H15.6209C15.491 16.5731 15.3432 16.6406 15.1863 16.6942L15.1843 16.6952C15.0819 16.7301 14.9837 16.7536 15.0095 16.747C14.8167 16.7964 14.6175 16.8169 14.4187 16.8075C13.7488 16.7757 13.1119 16.5223 12.6013 16.1034C12.5792 16.0853 12.5572 16.0669 12.5359 16.0478L12.4558 15.9755C12.4289 15.9514 12.4023 15.9268 12.3767 15.9013L8.07691 11.6083C8.07353 11.6049 8.06951 11.601 8.06616 11.5976C7.53334 11.0578 7.20502 10.3357 7.1687 9.56729C7.15913 9.36475 7.18077 9.16186 7.23218 8.96572C7.24437 8.91924 7.25598 8.88157 7.26245 8.86123C7.26917 8.84013 7.27535 8.82331 7.27808 8.81533C7.28076 8.80749 7.28284 8.79908 7.28296 8.79873C7.28351 8.79716 7.28352 8.79807 7.28296 8.79971C7.33859 8.63724 7.40834 8.48843 7.47241 8.36514L7.57202 8.1835C7.67637 8.00265 7.7923 7.82674 7.9021 7.66982C8.15671 7.30606 8.46076 6.93034 8.67456 6.70205C8.67023 6.69765 8.66518 6.6938 8.66089 6.68936L6.09741 4.03604L6.07495 4.01553L4.80835 5.28115Z"/>
|
|
4
3
|
</svg>
|
|
@@ -7,4 +7,19 @@ describe('ExpandTransition', () => {
|
|
|
7
7
|
const wrapper = shallowMount(ExpandTransition);
|
|
8
8
|
expect(wrapper.exists()).toBe(true);
|
|
9
9
|
});
|
|
10
|
+
|
|
11
|
+
it('renders default slot content', () => {
|
|
12
|
+
const wrapper = shallowMount(ExpandTransition, {
|
|
13
|
+
slots: {
|
|
14
|
+
default: '<div class="content">hello</div>',
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
expect(wrapper.find('.content').text()).toBe('hello');
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('sets height to auto on afterEnter', () => {
|
|
21
|
+
const element = document.createElement('div');
|
|
22
|
+
ExpandTransition.methods.afterEnter(element);
|
|
23
|
+
expect(element.style.height).toBe('auto');
|
|
24
|
+
});
|
|
10
25
|
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import WtReplaceTransition from '../cases/wt-replace-transition.vue';
|
|
4
|
+
|
|
5
|
+
describe('WtReplaceTransition', () => {
|
|
6
|
+
it('renders default slot content', () => {
|
|
7
|
+
const wrapper = mount(WtReplaceTransition, {
|
|
8
|
+
slots: {
|
|
9
|
+
default: '<div class="content">hello</div>',
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
expect(wrapper.find('.content').text()).toBe('hello');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('builds the transition name from the default opacity pattern', () => {
|
|
16
|
+
const wrapper = mount(WtReplaceTransition, {
|
|
17
|
+
slots: {
|
|
18
|
+
default: '<div />',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
expect(
|
|
22
|
+
wrapper
|
|
23
|
+
.findComponent({
|
|
24
|
+
name: 'wt-transition',
|
|
25
|
+
})
|
|
26
|
+
.props('name'),
|
|
27
|
+
).toBe('fade-opacity');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('builds the transition name from a custom pattern', () => {
|
|
31
|
+
const wrapper = mount(WtReplaceTransition, {
|
|
32
|
+
props: {
|
|
33
|
+
pattern: 'slide-up',
|
|
34
|
+
},
|
|
35
|
+
slots: {
|
|
36
|
+
default: '<div />',
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
expect(
|
|
40
|
+
wrapper
|
|
41
|
+
.findComponent({
|
|
42
|
+
name: 'wt-transition',
|
|
43
|
+
})
|
|
44
|
+
.props('name'),
|
|
45
|
+
).toBe('fade-slide-up');
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('passes duration, appear and mode props through to wt-transition', () => {
|
|
49
|
+
const wrapper = mount(WtReplaceTransition, {
|
|
50
|
+
props: {
|
|
51
|
+
duration: 'slow',
|
|
52
|
+
appear: true,
|
|
53
|
+
mode: 'in-out',
|
|
54
|
+
},
|
|
55
|
+
slots: {
|
|
56
|
+
default: '<div />',
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
const inner = wrapper.findComponent({
|
|
60
|
+
name: 'wt-transition',
|
|
61
|
+
});
|
|
62
|
+
expect(inner.props('duration')).toBe('slow');
|
|
63
|
+
expect(inner.props('appear')).toBe(true);
|
|
64
|
+
expect(inner.props('mode')).toBe('in-out');
|
|
65
|
+
});
|
|
66
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import WtTransition from '../wt-transition.vue';
|
|
4
|
+
|
|
5
|
+
describe('WtTransition', () => {
|
|
6
|
+
it('renders default slot content', () => {
|
|
7
|
+
const wrapper = mount(WtTransition, {
|
|
8
|
+
slots: {
|
|
9
|
+
default: '<div class="content">hello</div>',
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
expect(wrapper.find('.content').text()).toBe('hello');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('applies the default fast duration class', () => {
|
|
16
|
+
const wrapper = mount(WtTransition, {
|
|
17
|
+
slots: {
|
|
18
|
+
default: '<div />',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
expect(wrapper.classes()).toContain('wt-transition--fast');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('applies a custom duration class', () => {
|
|
25
|
+
const wrapper = mount(WtTransition, {
|
|
26
|
+
props: {
|
|
27
|
+
duration: 'slow',
|
|
28
|
+
},
|
|
29
|
+
slots: {
|
|
30
|
+
default: '<div />',
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
expect(wrapper.classes()).toContain('wt-transition--slow');
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
|
|
3
|
+
import { IconAction } from '../../../enums';
|
|
4
|
+
import {
|
|
5
|
+
sectionActionsOrder,
|
|
6
|
+
tableActionsOrder,
|
|
7
|
+
} from '../WtActionBarActionsOrder.js';
|
|
8
|
+
import WtActionBar from '../wt-action-bar.vue';
|
|
9
|
+
|
|
10
|
+
describe('WtActionBar', () => {
|
|
11
|
+
it('renders a component', () => {
|
|
12
|
+
const wrapper = mount(WtActionBar);
|
|
13
|
+
expect(wrapper.exists()).toBe(true);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('renders table actions by default', () => {
|
|
17
|
+
const wrapper = mount(WtActionBar);
|
|
18
|
+
const actions = wrapper.findAllComponents({
|
|
19
|
+
name: 'wt-icon-action',
|
|
20
|
+
});
|
|
21
|
+
expect(actions.length).toBe(tableActionsOrder.length);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('renders section actions when mode is "section"', () => {
|
|
25
|
+
const wrapper = mount(WtActionBar, {
|
|
26
|
+
props: {
|
|
27
|
+
mode: 'section',
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const actions = wrapper.findAllComponents({
|
|
31
|
+
name: 'wt-icon-action',
|
|
32
|
+
});
|
|
33
|
+
expect(actions.length).toBe(sectionActionsOrder.length);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('renders only actions listed in include', () => {
|
|
37
|
+
const included = [
|
|
38
|
+
tableActionsOrder[0],
|
|
39
|
+
];
|
|
40
|
+
const wrapper = mount(WtActionBar, {
|
|
41
|
+
props: {
|
|
42
|
+
include: included,
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
const actions = wrapper.findAllComponents({
|
|
46
|
+
name: 'wt-icon-action',
|
|
47
|
+
});
|
|
48
|
+
expect(actions.length).toBe(included.length);
|
|
49
|
+
expect(actions[0].props('action')).toBe(included[0]);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('excludes actions listed in exclude', () => {
|
|
53
|
+
const excluded = tableActionsOrder[0];
|
|
54
|
+
const wrapper = mount(WtActionBar, {
|
|
55
|
+
props: {
|
|
56
|
+
exclude: [
|
|
57
|
+
excluded,
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
const actions = wrapper.findAllComponents({
|
|
62
|
+
name: 'wt-icon-action',
|
|
63
|
+
});
|
|
64
|
+
expect(actions.length).toBe(tableActionsOrder.length - 1);
|
|
65
|
+
expect(actions.some((a) => a.props('action') === excluded)).toBe(false);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('emits click:[action] when an action is clicked', async () => {
|
|
69
|
+
const action = tableActionsOrder[0];
|
|
70
|
+
const wrapper = mount(WtActionBar, {
|
|
71
|
+
props: {
|
|
72
|
+
include: [
|
|
73
|
+
action,
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
await wrapper
|
|
78
|
+
.findComponent({
|
|
79
|
+
name: 'wt-icon-action',
|
|
80
|
+
})
|
|
81
|
+
.trigger('click');
|
|
82
|
+
expect(wrapper.emitted(`click:${action}`)).toBeTruthy();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('disables an action via disabled:[action] prop', () => {
|
|
86
|
+
const action = IconAction.SORT;
|
|
87
|
+
const wrapper = mount(WtActionBar, {
|
|
88
|
+
props: {
|
|
89
|
+
include: [
|
|
90
|
+
action,
|
|
91
|
+
],
|
|
92
|
+
[`disabled:${action}`]: true,
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
expect(
|
|
96
|
+
wrapper
|
|
97
|
+
.findComponent({
|
|
98
|
+
name: 'wt-icon-action',
|
|
99
|
+
})
|
|
100
|
+
.props('disabled'),
|
|
101
|
+
).toBe(true);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('passes sort:order prop to sort action', () => {
|
|
105
|
+
const wrapper = mount(WtActionBar, {
|
|
106
|
+
props: {
|
|
107
|
+
include: [
|
|
108
|
+
IconAction.SORT,
|
|
109
|
+
],
|
|
110
|
+
'sort:order': 'asc',
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
expect(
|
|
114
|
+
wrapper
|
|
115
|
+
.findComponent({
|
|
116
|
+
name: 'wt-icon-action',
|
|
117
|
+
})
|
|
118
|
+
.props('sort:order'),
|
|
119
|
+
).toBe('asc');
|
|
120
|
+
});
|
|
121
|
+
});
|
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
v-bind="{ size }"
|
|
9
9
|
/>
|
|
10
10
|
|
|
11
|
+
<!-- @slot switcher here
|
|
12
|
+
@scope `{ size<ComponentSize> }`
|
|
13
|
+
-->
|
|
14
|
+
<slot
|
|
15
|
+
name="switcher"
|
|
16
|
+
v-bind="{ size }"
|
|
17
|
+
/>
|
|
18
|
+
|
|
11
19
|
<!-- @slot custom actions here
|
|
12
20
|
@scope `{ size<ComponentSize> }`
|
|
13
21
|
-->
|
|
@@ -23,7 +31,7 @@
|
|
|
23
31
|
>
|
|
24
32
|
<wt-icon-action
|
|
25
33
|
:action="action"
|
|
26
|
-
:disabled="
|
|
34
|
+
:disabled="isActionDisabled(action)"
|
|
27
35
|
v-bind="getActionProps(action)"
|
|
28
36
|
@click="handleActionClick(action)"
|
|
29
37
|
/>
|
|
@@ -31,26 +39,27 @@
|
|
|
31
39
|
</div>
|
|
32
40
|
</template>
|
|
33
41
|
|
|
34
|
-
<script setup>
|
|
35
|
-
import { computed } from 'vue';
|
|
42
|
+
<script setup lang="ts">
|
|
43
|
+
import { computed, type PropType } from 'vue';
|
|
36
44
|
|
|
37
|
-
import IconAction from '../../enums
|
|
45
|
+
import { IconAction, type IconAction as IconActionValue } from '../../enums';
|
|
38
46
|
import { kebabToCamel } from '../../scripts/caseConverters.js';
|
|
39
|
-
import { SortSymbols } from '../../scripts/sortQueryAdapters.js';
|
|
40
47
|
import WtIconAction from '../wt-icon-action/wt-icon-action.vue';
|
|
41
48
|
import {
|
|
42
49
|
sectionActionsOrder,
|
|
43
50
|
tableActionsOrder,
|
|
44
51
|
} from './WtActionBarActionsOrder.js';
|
|
45
52
|
|
|
53
|
+
type SortOrder = 'asc' | 'desc' | null;
|
|
54
|
+
|
|
46
55
|
const props = defineProps({
|
|
47
56
|
/**
|
|
48
57
|
* [`'table'`, `'section'`]
|
|
49
|
-
|
|
58
|
+
*/
|
|
50
59
|
mode: {
|
|
51
|
-
type: String
|
|
60
|
+
type: String as PropType<'table' | 'section'>,
|
|
52
61
|
default: 'table',
|
|
53
|
-
validator: (v) =>
|
|
62
|
+
validator: (v: string) =>
|
|
54
63
|
[
|
|
55
64
|
'table',
|
|
56
65
|
'section',
|
|
@@ -62,59 +71,69 @@ const props = defineProps({
|
|
|
62
71
|
*/
|
|
63
72
|
size: {
|
|
64
73
|
type: String,
|
|
65
|
-
// default: 'md',
|
|
66
|
-
// validator: (v) => ['sm', 'md', 'lg'].includes(v),
|
|
67
74
|
},
|
|
68
75
|
|
|
69
76
|
/**
|
|
70
77
|
* Leave the default value for the mode only listed in includes prop
|
|
71
78
|
*/
|
|
72
|
-
|
|
73
79
|
include: {
|
|
74
|
-
type: Array
|
|
80
|
+
type: Array as PropType<IconActionValue[]>,
|
|
75
81
|
default: () => [],
|
|
76
82
|
},
|
|
77
83
|
|
|
78
84
|
/**
|
|
79
85
|
* Leave the default values for the mode, except for those in exclude prop
|
|
80
86
|
*/
|
|
81
|
-
|
|
82
87
|
exclude: {
|
|
83
|
-
type: Array
|
|
88
|
+
type: Array as PropType<IconActionValue[]>,
|
|
84
89
|
default: () => [],
|
|
85
90
|
},
|
|
86
91
|
|
|
87
92
|
'sort:order': {
|
|
88
|
-
type: String
|
|
93
|
+
type: String as unknown as PropType<SortOrder>,
|
|
89
94
|
default: null,
|
|
90
95
|
required: false,
|
|
91
|
-
validator: (v) =>
|
|
96
|
+
validator: (v: SortOrder) =>
|
|
97
|
+
[
|
|
98
|
+
'asc',
|
|
99
|
+
'desc',
|
|
100
|
+
null,
|
|
101
|
+
].includes(v),
|
|
92
102
|
},
|
|
93
103
|
|
|
94
104
|
/**
|
|
95
105
|
* Built dynamically on `disabled:[IconAction]` pattern for all available [IconActions](../../enums/IconAction/Readme.md).
|
|
96
106
|
*/
|
|
97
|
-
|
|
98
107
|
disabled: {
|
|
99
|
-
// Not implemented, but can be used to disable all actions
|
|
100
108
|
type: Boolean,
|
|
101
109
|
default: false,
|
|
102
110
|
},
|
|
103
111
|
|
|
104
|
-
...Object.values(IconAction).reduce((acc, action) => {
|
|
105
|
-
acc[`disabled:${action}`] = {
|
|
106
|
-
type: Boolean,
|
|
107
|
-
default: false,
|
|
108
|
-
};
|
|
109
|
-
return acc;
|
|
110
|
-
}, {}),
|
|
111
|
-
});
|
|
112
|
-
const emit = defineEmits([
|
|
113
112
|
/**
|
|
114
|
-
*
|
|
113
|
+
* Vue SFC cannot resolve mapped types over imported `typeof` aliases, so
|
|
114
|
+
* `disabled:*` stay runtime-declared (same as pre-TS version).
|
|
115
115
|
*/
|
|
116
|
-
...Object.values(IconAction).
|
|
117
|
-
|
|
116
|
+
...Object.values(IconAction).reduce(
|
|
117
|
+
(acc, action) => {
|
|
118
|
+
acc[`disabled:${action}`] = {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: false,
|
|
121
|
+
};
|
|
122
|
+
return acc;
|
|
123
|
+
},
|
|
124
|
+
{} as Record<
|
|
125
|
+
`disabled:${IconActionValue}`,
|
|
126
|
+
{
|
|
127
|
+
type: BooleanConstructor;
|
|
128
|
+
default: false;
|
|
129
|
+
}
|
|
130
|
+
>,
|
|
131
|
+
),
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
const emit = defineEmits(
|
|
135
|
+
Object.values(IconAction).map((action) => `click:${action}` as const),
|
|
136
|
+
);
|
|
118
137
|
|
|
119
138
|
const shownActions = computed(() => {
|
|
120
139
|
const actionsOrder =
|
|
@@ -129,15 +148,20 @@ const shownActions = computed(() => {
|
|
|
129
148
|
return actionsOrder;
|
|
130
149
|
});
|
|
131
150
|
|
|
132
|
-
const handleActionClick = (action) => {
|
|
151
|
+
const handleActionClick = (action: IconActionValue) => {
|
|
133
152
|
emit(`click:${action}`);
|
|
134
153
|
};
|
|
135
154
|
|
|
136
|
-
const
|
|
155
|
+
const isActionDisabled = (action: IconActionValue): boolean => {
|
|
156
|
+
const key = `disabled:${kebabToCamel(action)}` as keyof typeof props;
|
|
157
|
+
return Boolean(props[key]);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const getActionProps = (action: IconActionValue) => {
|
|
137
161
|
switch (action) {
|
|
138
162
|
case IconAction.SORT:
|
|
139
163
|
return {
|
|
140
|
-
'sort:order': props['sort:order'],
|
|
164
|
+
'sort:order': props['sort:order'] ?? undefined,
|
|
141
165
|
};
|
|
142
166
|
default:
|
|
143
167
|
return {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { shallowMount } from '@vue/test-utils';
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
3
|
import { WtApplication } from '@webitel/ui-sdk/enums';
|
|
4
4
|
import WtAppNavigator from '../wt-app-navigator.vue';
|
|
@@ -6,22 +6,24 @@ import WtAppNavigator from '../wt-app-navigator.vue';
|
|
|
6
6
|
const apps = [
|
|
7
7
|
{
|
|
8
8
|
name: WtApplication.Admin,
|
|
9
|
-
href: '',
|
|
9
|
+
href: '/admin',
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
name: WtApplication.History,
|
|
13
|
-
href: '',
|
|
13
|
+
href: '/history',
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
name: WtApplication.Supervisor,
|
|
17
|
-
href: '',
|
|
17
|
+
href: '/supervisor',
|
|
18
18
|
},
|
|
19
19
|
];
|
|
20
|
+
|
|
20
21
|
describe('WtAppNavigator', () => {
|
|
21
22
|
it('renders a component', () => {
|
|
22
23
|
const wrapper = shallowMount(WtAppNavigator);
|
|
23
24
|
expect(wrapper.classes('wt-app-navigator')).toBe(true);
|
|
24
25
|
});
|
|
26
|
+
|
|
25
27
|
it('renders specified app cards', () => {
|
|
26
28
|
const wrapper = shallowMount(WtAppNavigator, {
|
|
27
29
|
props: {
|
|
@@ -30,4 +32,63 @@ describe('WtAppNavigator', () => {
|
|
|
30
32
|
});
|
|
31
33
|
expect(wrapper.findAll('.wt-app-navigator__card').length).toBe(3);
|
|
32
34
|
});
|
|
35
|
+
|
|
36
|
+
it('renders app cards ordered by the fixed navigator order, not input order', () => {
|
|
37
|
+
const wrapper = shallowMount(WtAppNavigator, {
|
|
38
|
+
props: {
|
|
39
|
+
apps: [
|
|
40
|
+
{
|
|
41
|
+
name: WtApplication.Crm,
|
|
42
|
+
href: '',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: WtApplication.Agent,
|
|
46
|
+
href: '',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: WtApplication.Admin,
|
|
50
|
+
href: '',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
const links = wrapper.findAll('.wt-app-navigator__card__link');
|
|
56
|
+
expect(links.map((l) => l.attributes('href'))).toEqual(
|
|
57
|
+
wrapper.vm.formattedApps.map((app) => app.href),
|
|
58
|
+
);
|
|
59
|
+
expect(wrapper.vm.formattedApps.map((app) => app.name)).toEqual([
|
|
60
|
+
WtApplication.Agent,
|
|
61
|
+
WtApplication.Admin,
|
|
62
|
+
WtApplication.Crm,
|
|
63
|
+
]);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('marks the current app as active', () => {
|
|
67
|
+
const wrapper = shallowMount(WtAppNavigator, {
|
|
68
|
+
props: {
|
|
69
|
+
apps,
|
|
70
|
+
currentApp: WtApplication.History,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
const activeCard = wrapper.find('.wt-app-navigator__card.active');
|
|
74
|
+
expect(activeCard.exists()).toBe(true);
|
|
75
|
+
expect(activeCard.text()).toContain('History');
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('is closed by default and toggles open when the trigger button is clicked', async () => {
|
|
79
|
+
const wrapper = mount(WtAppNavigator, {
|
|
80
|
+
props: {
|
|
81
|
+
apps,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
expect(wrapper.find('nav').attributes('style')).toContain('display: none');
|
|
85
|
+
|
|
86
|
+
await wrapper.find('.wt-app-navigator__btn').trigger('click');
|
|
87
|
+
expect(wrapper.find('nav').attributes('style') || '').not.toContain(
|
|
88
|
+
'display: none',
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
await wrapper.find('.wt-app-navigator__btn').trigger('click');
|
|
92
|
+
expect(wrapper.find('nav').attributes('style')).toContain('display: none');
|
|
93
|
+
});
|
|
33
94
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { shallowMount } from '@vue/test-utils';
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
2
|
|
|
3
3
|
import WtHeaderActions from '../wt-header-actions.vue';
|
|
4
4
|
|
|
@@ -8,7 +8,7 @@ describe('WtHeaderActions', () => {
|
|
|
8
8
|
expect(wrapper.classes('wt-header-actions')).toBe(true);
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
it('renders user data', () => {
|
|
11
|
+
it('renders user data from name/account fields', () => {
|
|
12
12
|
const user = {
|
|
13
13
|
name: 'user nanme',
|
|
14
14
|
account: 'acc@ou.nt',
|
|
@@ -23,4 +23,83 @@ describe('WtHeaderActions', () => {
|
|
|
23
23
|
user.account,
|
|
24
24
|
);
|
|
25
25
|
});
|
|
26
|
+
|
|
27
|
+
it('falls back to username/preferredUsername fields', () => {
|
|
28
|
+
const user = {
|
|
29
|
+
username: 'fallback-username',
|
|
30
|
+
preferredUsername: 'fallback@account',
|
|
31
|
+
};
|
|
32
|
+
const wrapper = shallowMount(WtHeaderActions, {
|
|
33
|
+
props: {
|
|
34
|
+
user,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
expect(wrapper.find('.wt-header-actions__name').text()).toBe(user.username);
|
|
38
|
+
expect(wrapper.find('.wt-header-actions__account').text()).toBe(
|
|
39
|
+
user.preferredUsername,
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('does not render header when user has no name or account', () => {
|
|
44
|
+
const wrapper = shallowMount(WtHeaderActions);
|
|
45
|
+
expect(wrapper.find('.wt-header-actions__header').exists()).toBe(false);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('does not render footer when buildInfo is not passed', () => {
|
|
49
|
+
const wrapper = shallowMount(WtHeaderActions);
|
|
50
|
+
expect(wrapper.find('.wt-header-actions__footer').exists()).toBe(false);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('renders build version in footer when buildInfo is passed', () => {
|
|
54
|
+
const wrapper = shallowMount(WtHeaderActions, {
|
|
55
|
+
props: {
|
|
56
|
+
buildInfo: {
|
|
57
|
+
release: '1.2.3',
|
|
58
|
+
build: '456',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
const footer = wrapper.find('.wt-header-actions__build__version');
|
|
63
|
+
expect(footer.exists()).toBe(true);
|
|
64
|
+
expect(footer.text()).toContain('1.2.3-456');
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('emits settings and closes the panel when settings is clicked', async () => {
|
|
68
|
+
const wrapper = mount(WtHeaderActions);
|
|
69
|
+
await wrapper.find('.wt-header-actions__btn').trigger('click');
|
|
70
|
+
|
|
71
|
+
const settingsLink = wrapper.findAll('.wt-header-actions__action__link')[1];
|
|
72
|
+
await settingsLink.trigger('click');
|
|
73
|
+
expect(wrapper.emitted().settings).toBeTruthy();
|
|
74
|
+
expect(
|
|
75
|
+
wrapper.find('.wt-header-actions__panel-wrapper').attributes('style'),
|
|
76
|
+
).toContain('display: none');
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('emits logout and closes the panel when logout is clicked', async () => {
|
|
80
|
+
const wrapper = mount(WtHeaderActions);
|
|
81
|
+
await wrapper.find('.wt-header-actions__btn').trigger('click');
|
|
82
|
+
|
|
83
|
+
const logoutLink = wrapper.find(
|
|
84
|
+
'.wt-header-actions__action--logout .wt-header-actions__action__link',
|
|
85
|
+
);
|
|
86
|
+
await logoutLink.trigger('click');
|
|
87
|
+
expect(wrapper.emitted().logout).toBeTruthy();
|
|
88
|
+
expect(
|
|
89
|
+
wrapper.find('.wt-header-actions__panel-wrapper').attributes('style'),
|
|
90
|
+
).toContain('display: none');
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('toggles panel visibility when the account button is clicked', async () => {
|
|
94
|
+
const wrapper = mount(WtHeaderActions);
|
|
95
|
+
expect(
|
|
96
|
+
wrapper.find('.wt-header-actions__panel-wrapper').attributes('style'),
|
|
97
|
+
).toContain('display: none');
|
|
98
|
+
|
|
99
|
+
await wrapper.find('.wt-header-actions__btn').trigger('click');
|
|
100
|
+
const style =
|
|
101
|
+
wrapper.find('.wt-header-actions__panel-wrapper').attributes('style') ||
|
|
102
|
+
'';
|
|
103
|
+
expect(style).not.toContain('display: none');
|
|
104
|
+
});
|
|
26
105
|
});
|