@dimailn/vuetify 2.7.2-alpha32 → 2.7.2-alpha34
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/vuetify.js +544 -366
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +1 -1
- package/dist/vuetify.min.js +2 -2
- package/es5/components/VCalendar/VCalendarWeekly.js +10 -5
- package/es5/components/VCalendar/VCalendarWeekly.js.map +1 -1
- package/es5/components/VCheckbox/VCheckbox.js +7 -9
- package/es5/components/VCheckbox/VCheckbox.js.map +1 -1
- package/es5/components/VContent/VContent.js +24 -5
- package/es5/components/VContent/VContent.js.map +1 -1
- package/es5/components/VCounter/VCounter.js.map +1 -1
- package/es5/components/VDatePicker/VDatePicker.js +15 -7
- package/es5/components/VDatePicker/VDatePicker.js.map +1 -1
- package/es5/components/VDatePicker/VDatePickerTitle.js +30 -19
- package/es5/components/VDatePicker/VDatePickerTitle.js.map +1 -1
- package/es5/components/VDatePicker/mixins/date-picker-table.js +1 -1
- package/es5/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
- package/es5/components/VDatePicker/util/eventHelpers.js +27 -17
- package/es5/components/VDatePicker/util/eventHelpers.js.map +1 -1
- package/es5/components/VExpansionPanel/VExpansionPanelContent.js.map +1 -1
- package/es5/components/VExpansionPanel/VExpansionPanelHeader.js.map +1 -1
- package/es5/components/VGrid/VCol.js +3 -1
- package/es5/components/VGrid/VCol.js.map +1 -1
- package/es5/components/VGrid/VContainer.js +23 -10
- package/es5/components/VGrid/VContainer.js.map +1 -1
- package/es5/components/VGrid/grid.js +33 -15
- package/es5/components/VGrid/grid.js.map +1 -1
- package/es5/components/VHover/VHover.js +23 -17
- package/es5/components/VHover/VHover.js.map +1 -1
- package/es5/components/VIcon/VIcon.js +77 -53
- package/es5/components/VIcon/VIcon.js.map +1 -1
- package/es5/components/VItemGroup/VItemGroup.js +5 -0
- package/es5/components/VItemGroup/VItemGroup.js.map +1 -1
- package/es5/components/VLabel/VLabel.js +3 -1
- package/es5/components/VLabel/VLabel.js.map +1 -1
- package/es5/components/VOtpInput/VOtpInput.js +54 -33
- package/es5/components/VOtpInput/VOtpInput.js.map +1 -1
- package/es5/components/VOverflowBtn/VOverflowBtn.js +14 -13
- package/es5/components/VOverflowBtn/VOverflowBtn.js.map +1 -1
- package/es5/components/VProgressLinear/VProgressLinear.js +12 -33
- package/es5/components/VProgressLinear/VProgressLinear.js.map +1 -1
- package/es5/components/VSelect/VSelect.js +4 -1
- package/es5/components/VSelect/VSelect.js.map +1 -1
- package/es5/components/VStepper/VStepper.js +1 -1
- package/es5/components/VStepper/VStepper.js.map +1 -1
- package/es5/components/VStepper/VStepperContent.js +2 -5
- package/es5/components/VStepper/VStepperContent.js.map +1 -1
- package/es5/components/VSwitch/VSwitch.js +1 -1
- package/es5/components/VSwitch/VSwitch.js.map +1 -1
- package/es5/components/VTabs/VTabs.js +5 -0
- package/es5/components/VTabs/VTabs.js.map +1 -1
- package/es5/components/VTabs/VTabsBar.js +3 -0
- package/es5/components/VTabs/VTabsBar.js.map +1 -1
- package/es5/components/VTextField/VTextField.js +2 -1
- package/es5/components/VTextField/VTextField.js.map +1 -1
- package/es5/components/VTooltip/VTooltip.js +0 -7
- package/es5/components/VTooltip/VTooltip.js.map +1 -1
- package/es5/directives/color/index.js +6 -3
- package/es5/directives/color/index.js.map +1 -1
- package/es5/directives/ripple/index.js +5 -2
- package/es5/directives/ripple/index.js.map +1 -1
- package/es5/directives/scroll/index.js +1 -2
- package/es5/directives/scroll/index.js.map +1 -1
- package/es5/directives/touch/index.js +7 -4
- package/es5/directives/touch/index.js.map +1 -1
- package/es5/framework.js +1 -1
- package/es5/mixins/activatable/index.js +0 -8
- package/es5/mixins/activatable/index.js.map +1 -1
- package/es5/mixins/groupable/index.js.map +1 -1
- package/es5/mixins/positionable/index.js.map +1 -1
- package/es5/mixins/proxyable/index.js.map +1 -1
- package/es5/mixins/registrable/index.js.map +1 -1
- package/es5/mixins/selectable/index.js +4 -2
- package/es5/mixins/selectable/index.js.map +1 -1
- package/es5/mixins/toggleable/index.js.map +1 -1
- package/es5/services/goto/util.js +42 -3
- package/es5/services/goto/util.js.map +1 -1
- package/es5/services/theme/index.js +20 -71
- package/es5/services/theme/index.js.map +1 -1
- package/es5/util/mergeData.js +6 -5
- package/es5/util/mergeData.js.map +1 -1
- package/es5/util/mixins.js +4 -3
- package/es5/util/mixins.js.map +1 -1
- package/lib/components/VCalendar/VCalendarWeekly.js +11 -6
- package/lib/components/VCalendar/VCalendarWeekly.js.map +1 -1
- package/lib/components/VCheckbox/VCheckbox.js +5 -8
- package/lib/components/VCheckbox/VCheckbox.js.map +1 -1
- package/lib/components/VContent/VContent.js +18 -3
- package/lib/components/VContent/VContent.js.map +1 -1
- package/lib/components/VCounter/VCounter.js.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.js +17 -7
- package/lib/components/VDatePicker/VDatePicker.js.map +1 -1
- package/lib/components/VDatePicker/VDatePickerTitle.js +25 -14
- package/lib/components/VDatePicker/VDatePickerTitle.js.map +1 -1
- package/lib/components/VDatePicker/mixins/date-picker-table.js +1 -1
- package/lib/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
- package/lib/components/VDatePicker/util/eventHelpers.js +26 -14
- package/lib/components/VDatePicker/util/eventHelpers.js.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelContent.js.map +1 -1
- package/lib/components/VExpansionPanel/VExpansionPanelHeader.js.map +1 -1
- package/lib/components/VGrid/VCol.js +3 -1
- package/lib/components/VGrid/VCol.js.map +1 -1
- package/lib/components/VGrid/VContainer.js +11 -10
- package/lib/components/VGrid/VContainer.js.map +1 -1
- package/lib/components/VGrid/grid.js +15 -14
- package/lib/components/VGrid/grid.js.map +1 -1
- package/lib/components/VHover/VHover.js +23 -18
- package/lib/components/VHover/VHover.js.map +1 -1
- package/lib/components/VIcon/VIcon.js +79 -57
- package/lib/components/VIcon/VIcon.js.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.js +5 -0
- package/lib/components/VItemGroup/VItemGroup.js.map +1 -1
- package/lib/components/VLabel/VLabel.js +3 -1
- package/lib/components/VLabel/VLabel.js.map +1 -1
- package/lib/components/VOtpInput/VOtpInput.js +58 -34
- package/lib/components/VOtpInput/VOtpInput.js.map +1 -1
- package/lib/components/VOverflowBtn/VOverflowBtn.js +14 -14
- package/lib/components/VOverflowBtn/VOverflowBtn.js.map +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.js +12 -16
- package/lib/components/VProgressLinear/VProgressLinear.js.map +1 -1
- package/lib/components/VSelect/VSelect.js +4 -1
- package/lib/components/VSelect/VSelect.js.map +1 -1
- package/lib/components/VStepper/VStepper.js +1 -1
- package/lib/components/VStepper/VStepper.js.map +1 -1
- package/lib/components/VStepper/VStepperContent.js +3 -6
- package/lib/components/VStepper/VStepperContent.js.map +1 -1
- package/lib/components/VSwitch/VSwitch.js +1 -1
- package/lib/components/VSwitch/VSwitch.js.map +1 -1
- package/lib/components/VTabs/VTabs.js +5 -0
- package/lib/components/VTabs/VTabs.js.map +1 -1
- package/lib/components/VTabs/VTabsBar.js +3 -0
- package/lib/components/VTabs/VTabsBar.js.map +1 -1
- package/lib/components/VTextField/VTextField.js +2 -1
- package/lib/components/VTextField/VTextField.js.map +1 -1
- package/lib/components/VTooltip/VTooltip.js +1 -8
- package/lib/components/VTooltip/VTooltip.js.map +1 -1
- package/lib/directives/color/index.js +6 -3
- package/lib/directives/color/index.js.map +1 -1
- package/lib/directives/ripple/index.js +5 -3
- package/lib/directives/ripple/index.js.map +1 -1
- package/lib/directives/scroll/index.js +1 -2
- package/lib/directives/scroll/index.js.map +1 -1
- package/lib/directives/touch/index.js +7 -4
- package/lib/directives/touch/index.js.map +1 -1
- package/lib/framework.js +1 -1
- package/lib/mixins/activatable/index.js +1 -8
- package/lib/mixins/activatable/index.js.map +1 -1
- package/lib/mixins/groupable/index.js.map +1 -1
- package/lib/mixins/positionable/index.js.map +1 -1
- package/lib/mixins/proxyable/index.js.map +1 -1
- package/lib/mixins/registrable/index.js.map +1 -1
- package/lib/mixins/selectable/index.js +9 -7
- package/lib/mixins/selectable/index.js.map +1 -1
- package/lib/mixins/toggleable/index.js.map +1 -1
- package/lib/services/goto/util.js +42 -3
- package/lib/services/goto/util.js.map +1 -1
- package/lib/services/theme/index.js +18 -64
- package/lib/services/theme/index.js.map +1 -1
- package/lib/util/mergeData.js +6 -5
- package/lib/util/mergeData.js.map +1 -1
- package/lib/util/mixins.js +3 -2
- package/lib/util/mixins.js.map +1 -1
- package/package.json +2 -2
- package/src/components/VAlert/__tests__/__snapshots__/VAlert.spec.ts.snap +4 -4
- package/src/components/VAppBar/__tests__/__snapshots__/VAppBarNavIcon.spec.ts.snap +2 -2
- package/src/components/VAutocomplete/__tests__/VAutocomplete.spec.ts +75 -20
- package/src/components/VAutocomplete/__tests__/VAutocomplete2.spec.ts +38 -40
- package/src/components/VAutocomplete/__tests__/VAutocomplete3.spec.ts +26 -26
- package/src/components/VBanner/__tests__/__snapshots__/VBanner.spec.ts.snap +2 -2
- package/src/components/VBtn/__tests__/VBtn.spec.ts +8 -4
- package/src/components/VCalendar/VCalendarWeekly.ts +12 -5
- package/src/components/VCalendar/__tests__/VCalendar.spec.ts +1 -1
- package/src/components/VCalendar/__tests__/VCalendarCategory.spec.ts +5 -5
- package/src/components/VCalendar/__tests__/__snapshots__/VCalendar.spec.ts.snap +167 -168
- package/src/components/VCheckbox/VCheckbox.ts +4 -9
- package/src/components/VCheckbox/__tests__/VCheckbox.spec.ts +7 -1
- package/src/components/VCheckbox/__tests__/__snapshots__/VCheckbox.spec.ts.snap +54 -50
- package/src/components/VColorPicker/__tests__/__snapshots__/VColorPicker.spec.ts.snap +18 -18
- package/src/components/VColorPicker/__tests__/__snapshots__/VColorPickerEdit.spec.ts.snap +10 -10
- package/src/components/VCombobox/__tests__/VCombobox-multiple.spec.ts +89 -69
- package/src/components/VCombobox/__tests__/VCombobox.spec.ts +17 -12
- package/src/components/VContent/VContent.ts +10 -2
- package/src/components/VCounter/VCounter.ts +1 -1
- package/src/components/VCounter/__tests__/VCounter.spec.ts +10 -25
- package/src/components/VDataIterator/__tests__/__snapshots__/VDataFooter.spec.ts.snap +42 -42
- package/src/components/VDataIterator/__tests__/__snapshots__/VDataIterator.spec.ts.snap +30 -30
- package/src/components/VDataTable/__tests__/VDataTable.spec.ts +1 -1
- package/src/components/VDataTable/__tests__/VDataTableHeader.spec.ts +6 -10
- package/src/components/VDataTable/__tests__/VEditDialog.spec.ts +24 -21
- package/src/components/VDataTable/__tests__/__snapshots__/VDataTable.spec.ts.snap +409 -409
- package/src/components/VDataTable/__tests__/__snapshots__/VDataTableHeader.spec.ts.snap +70 -70
- package/src/components/VDataTable/mixins/__tests__/__snapshots__/header.spec.ts.snap +8 -8
- package/src/components/VDataTable/mixins/__tests__/header.spec.ts +3 -3
- package/src/components/VDatePicker/VDatePicker.ts +23 -7
- package/src/components/VDatePicker/VDatePickerTitle.ts +28 -16
- package/src/components/VDatePicker/__tests__/VDatePicker.date.spec.ts +86 -124
- package/src/components/VDatePicker/__tests__/VDatePicker.month.spec.ts +85 -63
- package/src/components/VDatePicker/__tests__/VDatePickerHeader.spec.ts +12 -27
- package/src/components/VDatePicker/__tests__/VDatePickerTitle.spec.ts +9 -5
- package/src/components/VDatePicker/__tests__/VDatePickerYears.spec.ts +4 -4
- package/src/components/VDatePicker/__tests__/__snapshots__/VDatePicker.date.spec.ts.snap +27 -9
- package/src/components/VDatePicker/__tests__/__snapshots__/VDatePicker.month.spec.ts.snap +45 -35
- package/src/components/VDatePicker/__tests__/__snapshots__/VDatePickerTitle.spec.ts.snap +15 -5
- package/src/components/VDatePicker/mixins/date-picker-table.ts +1 -1
- package/src/components/VDatePicker/util/eventHelpers.ts +33 -13
- package/src/components/VExpansionPanel/VExpansionPanelContent.ts +5 -8
- package/src/components/VExpansionPanel/VExpansionPanelHeader.ts +10 -14
- package/src/components/VExpansionPanel/__tests__/VExpansionPanelHeader.spec.ts +6 -4
- package/src/components/VExpansionPanel/__tests__/VExpansionPanels.spec.ts +9 -5
- package/src/components/VExpansionPanel/__tests__/__snapshots__/VExpansionPanel.spec.ts.snap +4 -4
- package/src/components/VFileInput/__tests__/__snapshots__/VFileInput.spec.ts.snap +38 -38
- package/src/components/VFooter/__tests__/VFooter.spec.ts +28 -21
- package/src/components/VGrid/VCol.ts +1 -1
- package/src/components/VGrid/VContainer.ts +12 -10
- package/src/components/VGrid/__tests__/VCol.spec.ts +4 -2
- package/src/components/VGrid/__tests__/VGrid.spec.ts +2 -3
- package/src/components/VGrid/grid.ts +14 -17
- package/src/components/VHover/VHover.ts +21 -17
- package/src/components/VHover/__tests__/VHover.spec.ts +44 -28
- package/src/components/VIcon/VIcon.ts +72 -53
- package/src/components/VIcon/__tests__/VIcon.spec.ts +86 -176
- package/src/components/VIcon/__tests__/__snapshots__/VIcon.spec.ts.snap +19 -74
- package/src/components/VItemGroup/VItemGroup.ts +5 -0
- package/src/components/VItemGroup/__tests__/VItem.spec.ts +20 -12
- package/src/components/VLabel/VLabel.ts +1 -1
- package/src/components/VList/__tests__/VListGroup.spec.ts +1 -1
- package/src/components/VList/__tests__/VListItemAction.spec.ts +32 -31
- package/src/components/VList/__tests__/__snapshots__/VListGroup.spec.ts.snap +2 -2
- package/src/components/VList/__tests__/__snapshots__/VListItemAction.spec.ts.snap +20 -6
- package/src/components/VOtpInput/VOtpInput.ts +57 -32
- package/src/components/VOtpInput/__tests__/VOtpInput.spec.ts +75 -78
- package/src/components/VOverflowBtn/VOverflowBtn.ts +13 -10
- package/src/components/VOverflowBtn/__tests__/VOverflowBtn.spec.ts +6 -6
- package/src/components/VOverflowBtn/__tests__/__snapshots__/VOverflowBtn.spec.ts.snap +38 -46
- package/src/components/VPagination/__tests__/__snapshots__/VPagination.spec.ts.snap +32 -32
- package/src/components/VProgressLinear/VProgressLinear.ts +13 -18
- package/src/components/VProgressLinear/__tests__/VProgressLinear.spec.ts +20 -12
- package/src/components/VRadioGroup/__tests__/VRadio.spec.ts +57 -44
- package/src/components/VRadioGroup/__tests__/VRadioGroup.spec.ts +4 -4
- package/src/components/VRadioGroup/__tests__/__snapshots__/VRadio.spec.ts.snap +29 -33
- package/src/components/VRadioGroup/__tests__/__snapshots__/VRadioGroup.spec.ts.snap +10 -18
- package/src/components/VRating/__tests__/VRating.spec.ts +24 -29
- package/src/components/VResponsive/__tests__/VResponsive.spec.ts +10 -5
- package/src/components/VSelect/VSelect.ts +5 -1
- package/src/components/VSelect/__tests__/VSelect2.spec.ts +5 -5
- package/src/components/VSelect/__tests__/VSelect3.spec.ts +7 -7
- package/src/components/VSelect/__tests__/VSelect4.spec.ts +2 -2
- package/src/components/VSelect/__tests__/__snapshots__/VSelect2.spec.ts.snap +4 -4
- package/src/components/VSelect/__tests__/__snapshots__/VSelect3.spec.ts.snap +0 -284
- package/src/components/VSelect/__tests__/__snapshots__/VSelectList.spec.ts.snap +30 -27
- package/src/components/VSlideGroup/__tests__/VSlideGroup.spec.ts +70 -62
- package/src/components/VSlideGroup/__tests__/__snapshots__/VSlideGroup.spec.ts.snap +13 -34
- package/src/components/VSnackbar/__tests__/VSnackbar.spec.ts +46 -37
- package/src/components/VStepper/VStepper.ts +2 -2
- package/src/components/VStepper/VStepperContent.ts +7 -12
- package/src/components/VStepper/__tests__/VStepper.spec.ts +3 -3
- package/src/components/VStepper/__tests__/VStepperContent.spec.ts +25 -6
- package/src/components/VStepper/__tests__/__snapshots__/VStepperStep.spec.ts.snap +10 -12
- package/src/components/VSwitch/VSwitch.ts +1 -1
- package/src/components/VSwitch/__tests__/VSwitch.spec.ts +4 -7
- package/src/components/VSwitch/__tests__/__snapshots__/VSwitch.spec.ts.snap +11 -15
- package/src/components/VTabs/VTabs.ts +5 -0
- package/src/components/VTabs/VTabsBar.ts +4 -0
- package/src/components/VTabs/__tests__/VTabs.spec.ts +65 -0
- package/src/components/VTextField/VTextField.ts +2 -1
- package/src/components/VTextField/__tests__/VTextField.spec.ts +24 -27
- package/src/components/VTextField/__tests__/__snapshots__/VTextField.spec.ts.snap +49 -73
- package/src/components/VTextarea/__tests__/__snapshots__/VTextarea.spec.ts.snap +16 -6
- package/src/components/VThemeProvider/__tests__/VThemeProvider.spec.ts +49 -10
- package/src/components/VTimePicker/__tests__/VTimePicker.spec.ts +3 -3
- package/src/components/VTimePicker/__tests__/VTimePickerTitle.spec.ts +3 -3
- package/src/components/VTimeline/__tests__/__snapshots__/VTimelineItem.spec.ts.snap +2 -2
- package/src/components/VTooltip/VTooltip.ts +0 -6
- package/src/components/VTooltip/__tests__/VTooltip.spec.ts +12 -11
- package/src/components/VTreeview/__tests__/__snapshots__/VTreeview.spec.ts.snap +42 -42
- package/src/components/VTreeview/__tests__/__snapshots__/VTreeviewNode.spec.ts.snap +2 -2
- package/src/directives/click-outside/__tests__/click-outside-shadow-dom.spec.ts +4 -4
- package/src/directives/click-outside/__tests__/click-outside.spec.ts +3 -3
- package/src/directives/color/__tests__/color.spec.ts +54 -34
- package/src/directives/color/index.ts +7 -3
- package/src/directives/intersect/__tests__/intersect.spec.ts +7 -7
- package/src/directives/mutate/__tests__/mutate.spec.ts +32 -26
- package/src/directives/resize/__tests__/resize.spec.ts +5 -5
- package/src/directives/ripple/__tests__/ripple.spec.ts +34 -36
- package/src/directives/ripple/index.ts +3 -6
- package/src/directives/scroll/__tests__/scroll.spec.ts +13 -13
- package/src/directives/scroll/index.ts +0 -1
- package/src/directives/touch/__tests__/touch.spec.ts +23 -16
- package/src/directives/touch/index.ts +6 -4
- package/src/globals.d.ts +6 -6
- package/src/mixins/activatable/__tests__/activatable.spec.ts +55 -55
- package/src/mixins/activatable/index.ts +0 -6
- package/src/mixins/dependent/__tests__/dependent.spec.ts +72 -33
- package/src/mixins/detachable/__tests__/detachable.spec.ts +45 -31
- package/src/mixins/groupable/index.ts +6 -6
- package/src/mixins/positionable/index.ts +2 -2
- package/src/mixins/proxyable/index.ts +2 -2
- package/src/mixins/registrable/index.ts +4 -4
- package/src/mixins/selectable/index.ts +10 -7
- package/src/mixins/toggleable/index.ts +2 -2
- package/src/services/goto/__tests__/goto.spec.ts +146 -1
- package/src/services/goto/util.ts +44 -5
- package/src/services/theme/__tests__/__snapshots__/theme.spec.ts.snap +0 -1128
- package/src/services/theme/__tests__/theme.spec.ts +81 -83
- package/src/services/theme/index.ts +22 -60
- package/src/util/__tests__/dom.spec.ts +8 -5
- package/src/util/__tests__/helpers.spec.ts +1 -1
- package/src/util/__tests__/mergeData.spec.ts +8 -8
- package/src/util/mergeData.ts +10 -5
- package/src/util/mixins.ts +24 -7
- package/types/alacarte.d.ts +14 -14
- package/types/index.d.ts +8 -8
- package/types/lib.d.ts +173 -173
|
@@ -1,76 +1,93 @@
|
|
|
1
|
-
// Libraries
|
|
2
|
-
import Vue from 'vue'
|
|
3
|
-
|
|
4
1
|
// Components
|
|
5
2
|
import VHover from '../VHover'
|
|
6
3
|
|
|
7
4
|
// Utilities
|
|
8
5
|
import {
|
|
9
6
|
mount,
|
|
10
|
-
|
|
7
|
+
VueWrapper,
|
|
8
|
+
enableAutoUnmount,
|
|
11
9
|
} from '@vue/test-utils'
|
|
10
|
+
import { h } from 'vue'
|
|
12
11
|
import { wait } from '../../../../test'
|
|
12
|
+
import { config } from '@vue/test-utils'
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
class: 'foobar',
|
|
17
|
-
class: { fizzbuzz: props.hover },
|
|
14
|
+
const item = (props: any) => h('div', {
|
|
15
|
+
class: ['foobar', { fizzbuzz: props.hover }],
|
|
18
16
|
})
|
|
19
17
|
|
|
20
18
|
describe('VHover.ts', () => {
|
|
21
|
-
let mountFunction: (options?: object) =>
|
|
19
|
+
let mountFunction: (options?: object) => VueWrapper<InstanceType<typeof VHover>>
|
|
20
|
+
|
|
21
|
+
enableAutoUnmount(afterEach)
|
|
22
22
|
|
|
23
23
|
beforeEach(() => {
|
|
24
24
|
mountFunction = (options = {}) => {
|
|
25
25
|
return mount(VHover, {
|
|
26
26
|
...options,
|
|
27
|
+
global: {
|
|
28
|
+
mocks: {
|
|
29
|
+
...config.global.mocks,
|
|
30
|
+
$_alreadyWarned: [],
|
|
31
|
+
parent: null,
|
|
32
|
+
constructor: {},
|
|
33
|
+
appContext: {},
|
|
34
|
+
props: {},
|
|
35
|
+
setupState: {},
|
|
36
|
+
},
|
|
37
|
+
...options.global,
|
|
38
|
+
},
|
|
27
39
|
})
|
|
28
40
|
}
|
|
29
41
|
})
|
|
30
42
|
|
|
31
43
|
it('should change class when hovered', async () => {
|
|
32
44
|
const wrapper = mountFunction({
|
|
33
|
-
|
|
45
|
+
slots: {
|
|
34
46
|
default: item,
|
|
35
47
|
},
|
|
36
48
|
})
|
|
37
49
|
|
|
38
50
|
const div = wrapper.find('.foobar')
|
|
39
51
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
await wait()
|
|
52
|
+
// Call methods directly since trigger doesn't work with our custom event handlers
|
|
53
|
+
wrapper.vm.onMouseEnter()
|
|
54
|
+
await wait(100)
|
|
43
55
|
|
|
44
|
-
expect(div.
|
|
56
|
+
expect(div.classes('fizzbuzz')).toBe(true)
|
|
45
57
|
|
|
46
|
-
|
|
58
|
+
wrapper.vm.onMouseLeave()
|
|
47
59
|
|
|
48
60
|
// Wait for runDelay
|
|
49
61
|
await wait(200)
|
|
50
62
|
|
|
51
|
-
expect(div.
|
|
63
|
+
expect(div.classes('fizzbuzz')).toBe(false)
|
|
52
64
|
})
|
|
53
65
|
|
|
54
66
|
it('should not react to changes when disabled', async () => {
|
|
55
67
|
const wrapper = mountFunction({
|
|
56
|
-
|
|
68
|
+
props: {
|
|
57
69
|
disabled: true,
|
|
58
|
-
|
|
70
|
+
modelValue: true,
|
|
59
71
|
},
|
|
60
|
-
|
|
72
|
+
slots: {
|
|
61
73
|
default: item,
|
|
62
74
|
},
|
|
63
75
|
})
|
|
64
76
|
|
|
65
77
|
const div = wrapper.find('.foobar')
|
|
66
78
|
|
|
67
|
-
|
|
79
|
+
// When disabled, the component should start with modelValue state
|
|
80
|
+
// But we need to wait for the component to render with the correct state
|
|
81
|
+
await wait(100)
|
|
82
|
+
expect(div.classes('fizzbuzz')).toBe(true)
|
|
68
83
|
|
|
69
|
-
|
|
84
|
+
// Call methods directly - they should not change state when disabled
|
|
85
|
+
wrapper.vm.onMouseEnter()
|
|
86
|
+
await wait(100)
|
|
70
87
|
|
|
71
88
|
expect(div.classes('fizzbuzz')).toBe(true)
|
|
72
89
|
|
|
73
|
-
|
|
90
|
+
wrapper.vm.onMouseLeave()
|
|
74
91
|
|
|
75
92
|
// Wait for runDelay
|
|
76
93
|
await wait(200)
|
|
@@ -86,18 +103,17 @@ describe('VHover.ts', () => {
|
|
|
86
103
|
|
|
87
104
|
it('should warn when using multiple root elements', () => {
|
|
88
105
|
mountFunction({
|
|
89
|
-
|
|
90
|
-
|
|
106
|
+
props: {
|
|
107
|
+
modelValue: false,
|
|
91
108
|
},
|
|
92
109
|
slots: {
|
|
93
|
-
default: [
|
|
94
|
-
|
|
95
|
-
|
|
110
|
+
default: () => [
|
|
111
|
+
h('div'),
|
|
112
|
+
h('div'),
|
|
96
113
|
],
|
|
97
114
|
},
|
|
98
115
|
})
|
|
99
116
|
|
|
100
117
|
expect('v-hover should only contain a single element').toHaveBeenTipped()
|
|
101
|
-
expect('[Vue warn]: Multiple root nodes returned from render function. Render function should return a single root node.').toHaveBeenWarned()
|
|
102
118
|
})
|
|
103
119
|
})
|
|
@@ -13,7 +13,7 @@ import { convertToUnit, keys, remapInternalIcon } from '../../util/helpers'
|
|
|
13
13
|
import { defineComponent, CreateElement, VNode, VNodeChildren, VNodeData, h } from 'vue'
|
|
14
14
|
import mixins from '../../util/mixins'
|
|
15
15
|
import { VuetifyIcon, VuetifyIconComponent } from 'vuetify/types/services/icons'
|
|
16
|
-
import { normalizeAttrs } from '../../util/helpers'
|
|
16
|
+
import { normalizeAttrs, normalizeClasses } from '../../util/helpers'
|
|
17
17
|
|
|
18
18
|
enum SIZE_MAP {
|
|
19
19
|
xSmall = '12px',
|
|
@@ -32,8 +32,12 @@ function isSvgPath (icon: string): boolean {
|
|
|
32
32
|
return (/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(icon) && /[\dz]$/i.test(icon) && icon.length > 4)
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
function classesToString (classObj: Record<string, boolean>): string {
|
|
36
|
+
return Object.keys(classObj).filter(key => classObj[key]).join(' ')
|
|
37
|
+
}
|
|
38
|
+
|
|
35
39
|
|
|
36
|
-
const
|
|
40
|
+
export const VIconInternal = mixins(
|
|
37
41
|
BindsAttrs,
|
|
38
42
|
Colorable,
|
|
39
43
|
Sizeable,
|
|
@@ -70,10 +74,13 @@ const VIcon = mixins(
|
|
|
70
74
|
getIcon (): VuetifyIcon {
|
|
71
75
|
let iconName = ''
|
|
72
76
|
if (this.$slots.default) {
|
|
73
|
-
const
|
|
74
|
-
if(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
const slotChildren = this.$slots.default()
|
|
78
|
+
if (slotChildren && slotChildren[0]) {
|
|
79
|
+
const children = slotChildren[0].children
|
|
80
|
+
if(typeof children === 'string') {
|
|
81
|
+
iconName = children.trim()
|
|
82
|
+
}
|
|
83
|
+
}
|
|
77
84
|
}
|
|
78
85
|
return remapInternalIcon(this, iconName)
|
|
79
86
|
},
|
|
@@ -115,27 +122,38 @@ const VIcon = mixins(
|
|
|
115
122
|
}
|
|
116
123
|
return data
|
|
117
124
|
},
|
|
125
|
+
applyColors (data: any): void {
|
|
126
|
+
this.setTextColor(this.color, data)
|
|
127
|
+
},
|
|
118
128
|
getSvgWrapperData () {
|
|
119
129
|
const fontSize = this.getSize()
|
|
120
|
-
|
|
121
|
-
|
|
130
|
+
|
|
131
|
+
const defaultData = this.getDefaultData()
|
|
132
|
+
const normalizedClasses = normalizeClasses([defaultData.class, this.themeClasses])
|
|
133
|
+
|
|
134
|
+
const wrapperData: any = {
|
|
135
|
+
class: classesToString(normalizedClasses),
|
|
136
|
+
'aria-hidden': defaultData['aria-hidden'],
|
|
137
|
+
type: defaultData.type,
|
|
122
138
|
style: fontSize ? {
|
|
123
139
|
fontSize,
|
|
124
140
|
height: fontSize,
|
|
125
141
|
width: fontSize,
|
|
126
142
|
} : undefined,
|
|
143
|
+
...this.listeners$,
|
|
127
144
|
}
|
|
145
|
+
|
|
146
|
+
if(this.hasClickListener && this.disabled) {
|
|
147
|
+
wrapperData.disabled = true
|
|
148
|
+
}
|
|
149
|
+
|
|
128
150
|
this.applyColors(wrapperData)
|
|
129
151
|
|
|
130
152
|
return wrapperData
|
|
131
153
|
},
|
|
132
|
-
applyColors (data: VNodeData): void {
|
|
133
|
-
data.class = { ...data.class, ...this.themeClasses }
|
|
134
|
-
this.setTextColor(this.color, data)
|
|
135
|
-
},
|
|
136
154
|
renderFontIcon (icon: string): VNode {
|
|
137
155
|
const newChildren: VNodeChildren = []
|
|
138
|
-
|
|
156
|
+
const defaultData = this.getDefaultData()
|
|
139
157
|
|
|
140
158
|
let iconType = 'material-icons'
|
|
141
159
|
// Material Icon delimiter is _
|
|
@@ -151,37 +169,43 @@ const VIcon = mixins(
|
|
|
151
169
|
if (isFontAwesome5(iconType)) iconType = ''
|
|
152
170
|
}
|
|
153
171
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}, {})
|
|
172
|
+
// Создаем объект классов для иконки
|
|
173
|
+
const iconClasses = { [iconType]: true }
|
|
174
|
+
if (!isMaterialIcon) {
|
|
175
|
+
iconClasses[icon] = true
|
|
159
176
|
}
|
|
160
177
|
|
|
161
|
-
|
|
162
|
-
data.class[icon] = !isMaterialIcon
|
|
178
|
+
const allClasses = normalizeClasses([defaultData.class, this.themeClasses, iconClasses])
|
|
163
179
|
|
|
164
180
|
const fontSize = this.getSize()
|
|
165
|
-
|
|
181
|
+
const fontData: any = {
|
|
182
|
+
class: classesToString(allClasses),
|
|
183
|
+
'aria-hidden': defaultData['aria-hidden'],
|
|
184
|
+
type: defaultData.type,
|
|
185
|
+
style: fontSize ? { fontSize } : undefined,
|
|
186
|
+
...this.listeners$,
|
|
187
|
+
}
|
|
166
188
|
|
|
167
|
-
this.
|
|
189
|
+
if(this.hasClickListener && this.disabled) {
|
|
190
|
+
fontData.disabled = true
|
|
191
|
+
}
|
|
168
192
|
|
|
169
|
-
|
|
193
|
+
this.applyColors(fontData)
|
|
194
|
+
|
|
195
|
+
return h(this.hasClickListener ? 'button' : this.tag, fontData, {default: () => newChildren})
|
|
170
196
|
},
|
|
171
197
|
renderSvgIcon (icon: string): VNode {
|
|
172
|
-
const
|
|
198
|
+
const size = this.getSize()
|
|
199
|
+
const svgProps: any = {
|
|
173
200
|
class: 'v-icon__svg',
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
'aria-hidden': true,
|
|
179
|
-
},
|
|
201
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
202
|
+
viewBox: '0 0 24 24',
|
|
203
|
+
role: 'img',
|
|
204
|
+
'aria-hidden': true,
|
|
180
205
|
}
|
|
181
206
|
|
|
182
|
-
const size = this.getSize()
|
|
183
207
|
if (size) {
|
|
184
|
-
|
|
208
|
+
svgProps.style = {
|
|
185
209
|
fontSize: size,
|
|
186
210
|
height: size,
|
|
187
211
|
width: size,
|
|
@@ -189,11 +213,9 @@ const VIcon = mixins(
|
|
|
189
213
|
}
|
|
190
214
|
|
|
191
215
|
return h(this.hasClickListener ? 'button' : 'span', this.getSvgWrapperData(), [
|
|
192
|
-
h('svg',
|
|
216
|
+
h('svg', svgProps, [
|
|
193
217
|
h('path', {
|
|
194
|
-
|
|
195
|
-
d: icon,
|
|
196
|
-
},
|
|
218
|
+
d: icon,
|
|
197
219
|
}),
|
|
198
220
|
]),
|
|
199
221
|
])
|
|
@@ -201,29 +223,26 @@ const VIcon = mixins(
|
|
|
201
223
|
renderSvgIconComponent (
|
|
202
224
|
icon: VuetifyIconComponent
|
|
203
225
|
): VNode {
|
|
204
|
-
const data: VNodeData = {
|
|
205
|
-
class: {
|
|
206
|
-
'v-icon__component': true,
|
|
207
|
-
},
|
|
208
|
-
}
|
|
209
|
-
|
|
210
226
|
const size = this.getSize()
|
|
211
|
-
|
|
212
|
-
|
|
227
|
+
const componentClasses = normalizeClasses([
|
|
228
|
+
{ 'v-icon__component': true },
|
|
229
|
+
this.themeClasses
|
|
230
|
+
])
|
|
231
|
+
|
|
232
|
+
const componentData: any = {
|
|
233
|
+
class: classesToString(componentClasses),
|
|
234
|
+
style: size ? {
|
|
213
235
|
fontSize: size,
|
|
214
236
|
height: size,
|
|
215
237
|
width: size,
|
|
216
|
-
}
|
|
238
|
+
} : undefined,
|
|
239
|
+
...icon.props,
|
|
217
240
|
}
|
|
218
241
|
|
|
219
|
-
this.applyColors(
|
|
220
|
-
|
|
221
|
-
const component = icon.component
|
|
222
|
-
data.props = icon.props
|
|
223
|
-
data.nativeOn = data.on
|
|
242
|
+
this.applyColors(componentData)
|
|
224
243
|
|
|
225
244
|
return h(this.hasClickListener ? 'button' : 'span', this.getSvgWrapperData(), {default: () =>[
|
|
226
|
-
h(component,
|
|
245
|
+
h(icon.component, componentData),
|
|
227
246
|
]})
|
|
228
247
|
},
|
|
229
248
|
},
|
|
@@ -245,7 +264,7 @@ const VIcon = mixins(
|
|
|
245
264
|
export default defineComponent({
|
|
246
265
|
name: 'v-icon',
|
|
247
266
|
|
|
248
|
-
$_wrapperFor:
|
|
267
|
+
$_wrapperFor: VIconInternal,
|
|
249
268
|
|
|
250
269
|
functional: true,
|
|
251
270
|
|
|
@@ -258,7 +277,7 @@ export default defineComponent({
|
|
|
258
277
|
|
|
259
278
|
|
|
260
279
|
// console.log(children && children[0]?.children)
|
|
261
|
-
return h(
|
|
280
|
+
return h(VIconInternal, data, {
|
|
262
281
|
default: () => {
|
|
263
282
|
let iconName = ''
|
|
264
283
|
|
|
@@ -11,6 +11,9 @@ import {
|
|
|
11
11
|
enableAutoUnmount,
|
|
12
12
|
} from '@vue/test-utils'
|
|
13
13
|
|
|
14
|
+
// Импортируем внутренний компонент для прямого тестирования
|
|
15
|
+
import { VIconInternal } from '../VIcon'
|
|
16
|
+
|
|
14
17
|
interface MountContext {
|
|
15
18
|
props?: Record<string, any>
|
|
16
19
|
attrs?: Record<string, any>
|
|
@@ -181,38 +184,22 @@ describe('VIcon', () => {
|
|
|
181
184
|
})
|
|
182
185
|
|
|
183
186
|
describe('for global icon', () => {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
})
|
|
187
|
-
|
|
188
|
-
it('should render MD left icon from $checkboxOn', () => {
|
|
189
|
-
const wrapper = mountFunction({
|
|
190
|
-
$vuetify: {
|
|
191
|
-
icons: {
|
|
192
|
-
values: {
|
|
193
|
-
checkboxOn: 'check_box',
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
},
|
|
197
|
-
}, '$checkboxOn')
|
|
187
|
+
it('should render MDI icon from $checkboxOn', () => {
|
|
188
|
+
const wrapper = mountFunction({}, '$checkboxOn')
|
|
198
189
|
|
|
199
190
|
expect(wrapper.find('.v-icon').exists()).toBe(true)
|
|
200
|
-
expect(wrapper.element.classList).toContain('
|
|
191
|
+
expect(wrapper.element.classList).toContain('v-icon')
|
|
192
|
+
expect(wrapper.element.classList).toContain('mdi')
|
|
193
|
+
expect(wrapper.element.classList).toContain('mdi-checkbox-marked')
|
|
201
194
|
})
|
|
202
195
|
|
|
203
|
-
it('should render
|
|
204
|
-
const wrapper = mountFunction({
|
|
205
|
-
$vuetify: {
|
|
206
|
-
icons: {
|
|
207
|
-
values: {
|
|
208
|
-
prev: 'chevron_left',
|
|
209
|
-
},
|
|
210
|
-
},
|
|
211
|
-
},
|
|
212
|
-
}, '$prev')
|
|
196
|
+
it('should render MDI icon from $prev', () => {
|
|
197
|
+
const wrapper = mountFunction({}, '$prev')
|
|
213
198
|
|
|
214
199
|
expect(wrapper.find('.v-icon').exists()).toBe(true)
|
|
215
|
-
expect(wrapper.element.classList).toContain('
|
|
200
|
+
expect(wrapper.element.classList).toContain('v-icon')
|
|
201
|
+
expect(wrapper.element.classList).toContain('mdi')
|
|
202
|
+
expect(wrapper.element.classList).toContain('mdi-chevron-left')
|
|
216
203
|
})
|
|
217
204
|
})
|
|
218
205
|
|
|
@@ -238,181 +225,104 @@ describe('VIcon', () => {
|
|
|
238
225
|
},
|
|
239
226
|
})
|
|
240
227
|
|
|
241
|
-
beforeEach(() => {
|
|
242
|
-
// Mock $vuetify in mountFunction
|
|
243
|
-
})
|
|
244
|
-
|
|
245
228
|
it('should render component', () => {
|
|
246
|
-
const wrapper =
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
values: {
|
|
250
|
-
testIcon: {
|
|
251
|
-
component: getTestComponent(),
|
|
252
|
-
props: {
|
|
253
|
-
name: 'test icon',
|
|
254
|
-
},
|
|
255
|
-
},
|
|
256
|
-
},
|
|
257
|
-
},
|
|
229
|
+
const wrapper = mount(VIcon, {
|
|
230
|
+
slots: {
|
|
231
|
+
default: () => '$testIcon',
|
|
258
232
|
},
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
it('should render a colored component', () => {
|
|
266
|
-
const wrapper = mountFunction({
|
|
267
|
-
props: { color: 'green lighten-1' },
|
|
268
|
-
$vuetify: {
|
|
269
|
-
icons: {
|
|
270
|
-
values: {
|
|
271
|
-
testIcon: {
|
|
272
|
-
component: getTestComponent(),
|
|
273
|
-
props: {
|
|
274
|
-
name: 'test icon',
|
|
275
|
-
},
|
|
233
|
+
global: {
|
|
234
|
+
mocks: {
|
|
235
|
+
$vuetify: {
|
|
236
|
+
theme: {
|
|
237
|
+
current: 'light',
|
|
238
|
+
dark: false,
|
|
276
239
|
},
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
it('should render a disabled component', () => {
|
|
287
|
-
const wrapper = mountFunction({
|
|
288
|
-
props: { disabled: true },
|
|
289
|
-
$vuetify: {
|
|
290
|
-
icons: {
|
|
291
|
-
values: {
|
|
292
|
-
testIcon: {
|
|
293
|
-
component: getTestComponent(),
|
|
294
|
-
props: {
|
|
295
|
-
name: 'test icon',
|
|
240
|
+
icons: {
|
|
241
|
+
component: null,
|
|
242
|
+
values: {
|
|
243
|
+
testIcon: {
|
|
244
|
+
component: getTestComponent(),
|
|
245
|
+
props: {
|
|
246
|
+
name: 'test icon',
|
|
247
|
+
},
|
|
248
|
+
},
|
|
296
249
|
},
|
|
297
250
|
},
|
|
298
251
|
},
|
|
299
252
|
},
|
|
300
|
-
}
|
|
301
|
-
}
|
|
253
|
+
}
|
|
254
|
+
})
|
|
302
255
|
|
|
303
|
-
expect(wrapper.
|
|
256
|
+
expect(wrapper.find('.v-icon').exists()).toBe(true)
|
|
257
|
+
expect(wrapper.html()).toMatchSnapshot()
|
|
304
258
|
})
|
|
305
259
|
|
|
306
|
-
it('should
|
|
307
|
-
const
|
|
308
|
-
props: { [size]: true },
|
|
309
|
-
$vuetify: {
|
|
310
|
-
icons: {
|
|
311
|
-
values: {
|
|
312
|
-
testIcon: {
|
|
313
|
-
component: getTestComponent(),
|
|
314
|
-
props: {
|
|
315
|
-
name: 'test icon',
|
|
316
|
-
},
|
|
317
|
-
},
|
|
318
|
-
},
|
|
319
|
-
},
|
|
320
|
-
},
|
|
321
|
-
}, '$testIcon')
|
|
322
|
-
|
|
323
|
-
const small = iconFactory('small')
|
|
324
|
-
expect(small.html()).toMatchSnapshot()
|
|
325
|
-
|
|
326
|
-
const medium = iconFactory('medium')
|
|
327
|
-
expect(medium.html()).toMatchSnapshot()
|
|
328
|
-
|
|
329
|
-
const large = iconFactory('large')
|
|
330
|
-
expect(large.html()).toMatchSnapshot()
|
|
260
|
+
it('should trim name', () => {
|
|
261
|
+
const wrapper = mountFunction({}, ' add ')
|
|
331
262
|
|
|
332
|
-
|
|
333
|
-
expect(xLarge.html()).toMatchSnapshot()
|
|
263
|
+
expect(wrapper.find('.v-icon').exists()).toBe(true)
|
|
334
264
|
})
|
|
335
265
|
|
|
336
|
-
it('should render
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
component: getTestComponent(),
|
|
344
|
-
props: {
|
|
345
|
-
name: 'test icon',
|
|
346
|
-
},
|
|
347
|
-
},
|
|
348
|
-
},
|
|
349
|
-
},
|
|
266
|
+
it('should render an svg icon', async () => {
|
|
267
|
+
const svgPath = 'M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z'
|
|
268
|
+
|
|
269
|
+
// Тестируем напрямую внутренний компонент VIconInternal
|
|
270
|
+
const directWrapper = mount(VIconInternal, {
|
|
271
|
+
slots: {
|
|
272
|
+
default: () => svgPath,
|
|
350
273
|
},
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
icons: {
|
|
361
|
-
values: {
|
|
362
|
-
testIcon: {
|
|
363
|
-
component: getTestComponent(),
|
|
364
|
-
props: {
|
|
365
|
-
name: 'test icon',
|
|
274
|
+
global: {
|
|
275
|
+
mocks: {
|
|
276
|
+
$vuetify: {
|
|
277
|
+
theme: {
|
|
278
|
+
current: 'light',
|
|
279
|
+
dark: false,
|
|
280
|
+
themes: {
|
|
281
|
+
light: {},
|
|
282
|
+
dark: {},
|
|
366
283
|
},
|
|
367
284
|
},
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
expect(wrapper.element.classList).toContain('v-icon--right')
|
|
374
|
-
})
|
|
375
|
-
|
|
376
|
-
it('should be an accessible link', async () => {
|
|
377
|
-
const clickHandler = jest.fn()
|
|
378
|
-
const wrapper = mountFunction({
|
|
379
|
-
attrs: { onClick: clickHandler },
|
|
380
|
-
$vuetify: {
|
|
381
|
-
icons: {
|
|
382
|
-
values: {
|
|
383
|
-
testIcon: {
|
|
384
|
-
component: getTestComponent(),
|
|
385
|
-
props: {
|
|
386
|
-
name: 'test icon',
|
|
387
|
-
},
|
|
285
|
+
rtl: false,
|
|
286
|
+
icons: {
|
|
287
|
+
component: null,
|
|
288
|
+
values: {},
|
|
388
289
|
},
|
|
389
290
|
},
|
|
390
291
|
},
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
|
|
292
|
+
}
|
|
293
|
+
})
|
|
294
|
+
|
|
295
|
+
expect(directWrapper.html()).toMatchSnapshot()
|
|
395
296
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
expect(
|
|
399
|
-
expect(wrapper.element.getAttribute('type')).toBe('button')
|
|
297
|
+
await directWrapper.setProps({ large: true })
|
|
298
|
+
|
|
299
|
+
expect(directWrapper.html()).toMatchSnapshot()
|
|
400
300
|
})
|
|
401
301
|
|
|
402
|
-
it('should
|
|
403
|
-
const
|
|
404
|
-
|
|
405
|
-
|
|
302
|
+
it('should detect svg path correctly', () => {
|
|
303
|
+
const svgPath = 'M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z'
|
|
304
|
+
|
|
305
|
+
// Проверяем функцию определения SVG пути
|
|
306
|
+
const isSvgPath = (icon: string): boolean => {
|
|
307
|
+
return (/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(icon) && /[\dz]$/i.test(icon) && icon.length > 4)
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
expect(isSvgPath(svgPath)).toBe(true)
|
|
311
|
+
expect(isSvgPath('mdi-home')).toBe(false)
|
|
312
|
+
expect(isSvgPath('material-icons')).toBe(false)
|
|
313
|
+
expect(isSvgPath('M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z')).toBe(true)
|
|
406
314
|
})
|
|
407
315
|
|
|
408
|
-
it('should
|
|
409
|
-
const
|
|
316
|
+
it('should handle svg icon properties correctly', () => {
|
|
317
|
+
const svgPath = 'M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z'
|
|
318
|
+
const wrapper = mountFunction({}, svgPath)
|
|
410
319
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
expect(wrapper.
|
|
320
|
+
// Основные проверки для SVG иконки
|
|
321
|
+
expect(wrapper.element.tagName.toLowerCase()).toBe('span')
|
|
322
|
+
expect(wrapper.element.getAttribute('aria-hidden')).toBe('true')
|
|
323
|
+
expect(wrapper.element.classList.contains('v-icon')).toBe(true)
|
|
324
|
+
expect(wrapper.element.classList.contains('notranslate')).toBe(true)
|
|
325
|
+
expect(wrapper.element.classList.contains('theme--light')).toBe(true)
|
|
416
326
|
})
|
|
417
327
|
})
|
|
418
328
|
})
|