@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
|
@@ -4,27 +4,32 @@ import VSnackbar from '../VSnackbar'
|
|
|
4
4
|
// Utilities
|
|
5
5
|
import {
|
|
6
6
|
mount,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
MountingOptions,
|
|
8
|
+
VueWrapper,
|
|
9
|
+
enableAutoUnmount,
|
|
9
10
|
} from '@vue/test-utils'
|
|
10
11
|
|
|
11
12
|
describe('VSnackbar.ts', () => {
|
|
12
13
|
type Instance = InstanceType<typeof VSnackbar>
|
|
13
|
-
let mountFunction: (options?:
|
|
14
|
+
let mountFunction: (options?: MountingOptions<Instance>) => VueWrapper<Instance>
|
|
15
|
+
|
|
16
|
+
enableAutoUnmount(afterEach)
|
|
14
17
|
|
|
15
18
|
beforeEach(() => {
|
|
16
|
-
mountFunction = (options = {} as
|
|
19
|
+
mountFunction = (options = {} as MountingOptions<Instance>) => {
|
|
17
20
|
return mount(VSnackbar, {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
global: {
|
|
22
|
+
mocks: {
|
|
23
|
+
$vuetify: {
|
|
24
|
+
application: {
|
|
25
|
+
bar: 24,
|
|
26
|
+
bottom: 56,
|
|
27
|
+
footer: 48,
|
|
28
|
+
insetFooter: 32,
|
|
29
|
+
left: 256,
|
|
30
|
+
right: 256,
|
|
31
|
+
top: 64,
|
|
32
|
+
},
|
|
28
33
|
},
|
|
29
34
|
},
|
|
30
35
|
},
|
|
@@ -38,8 +43,8 @@ describe('VSnackbar.ts', () => {
|
|
|
38
43
|
[{ text: true }, false],
|
|
39
44
|
[{ outlined: true }, false],
|
|
40
45
|
[{ light: true }, false],
|
|
41
|
-
])('should be dark when using %s', (
|
|
42
|
-
const wrapper = mountFunction({
|
|
46
|
+
])('should be dark when using %s', (props, expected: boolean) => {
|
|
47
|
+
const wrapper = mountFunction({ props })
|
|
43
48
|
|
|
44
49
|
expect(wrapper.vm.isDark).toBe(expected)
|
|
45
50
|
})
|
|
@@ -50,7 +55,7 @@ describe('VSnackbar.ts', () => {
|
|
|
50
55
|
[true, '256px', '256px'],
|
|
51
56
|
])('should have app padding on the x-axis using %s', (app, left, right) => {
|
|
52
57
|
const wrapper = mountFunction({
|
|
53
|
-
|
|
58
|
+
props: { app },
|
|
54
59
|
})
|
|
55
60
|
|
|
56
61
|
expect(wrapper.vm.styles).toHaveProperty('paddingLeft', left)
|
|
@@ -63,7 +68,7 @@ describe('VSnackbar.ts', () => {
|
|
|
63
68
|
[true, false],
|
|
64
69
|
])('should have app padding on the x-axis using %s', (absolute, expected: boolean) => {
|
|
65
70
|
const wrapper = mountFunction({
|
|
66
|
-
|
|
71
|
+
props: {
|
|
67
72
|
app: true,
|
|
68
73
|
absolute,
|
|
69
74
|
},
|
|
@@ -76,34 +81,35 @@ describe('VSnackbar.ts', () => {
|
|
|
76
81
|
[undefined, false],
|
|
77
82
|
[false, false],
|
|
78
83
|
[true, true],
|
|
79
|
-
])('should conditionally invoke setTimeout method using %s', (
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
mountFunction({
|
|
83
|
-
propsData: { value },
|
|
84
|
-
methods: { setTimeout },
|
|
84
|
+
])('should conditionally invoke setTimeout method using %s', (modelValue, expected: boolean) => {
|
|
85
|
+
const wrapper = mountFunction({
|
|
86
|
+
props: { modelValue },
|
|
85
87
|
})
|
|
86
88
|
|
|
87
|
-
|
|
89
|
+
// Проверяем, что setTimeout вызывается через проверку activeTimeout
|
|
90
|
+
if (expected) {
|
|
91
|
+
expect(wrapper.vm.activeTimeout).toBeGreaterThanOrEqual(0)
|
|
92
|
+
} else {
|
|
93
|
+
expect(wrapper.vm.activeTimeout).toBe(-1)
|
|
94
|
+
}
|
|
88
95
|
})
|
|
89
96
|
|
|
90
97
|
it.each([
|
|
91
98
|
[undefined, false],
|
|
92
99
|
[false, true],
|
|
93
100
|
])('should conditionally render transition content using %s', (transition, expected: boolean) => {
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
propsData: { transition },
|
|
99
|
-
methods: {
|
|
100
|
-
genTransition,
|
|
101
|
-
genContent,
|
|
101
|
+
const wrapper = mountFunction({
|
|
102
|
+
props: {
|
|
103
|
+
transition,
|
|
104
|
+
modelValue: true, // Активируем компонент, чтобы увидеть transition
|
|
102
105
|
},
|
|
103
106
|
})
|
|
104
107
|
|
|
105
|
-
|
|
106
|
-
|
|
108
|
+
// Проверяем, что transition используется через проверку computed свойства
|
|
109
|
+
// Когда transition undefined, используется значение по умолчанию 'v-snack-transition'
|
|
110
|
+
// Когда transition false, transition не используется
|
|
111
|
+
const usesTransition = wrapper.vm.transition !== false
|
|
112
|
+
expect(usesTransition).toBe(!expected)
|
|
107
113
|
})
|
|
108
114
|
|
|
109
115
|
it.each([
|
|
@@ -116,9 +122,9 @@ describe('VSnackbar.ts', () => {
|
|
|
116
122
|
const spy = jest.spyOn(window, 'setTimeout')
|
|
117
123
|
|
|
118
124
|
mountFunction({
|
|
119
|
-
|
|
125
|
+
props: {
|
|
120
126
|
timeout,
|
|
121
|
-
|
|
127
|
+
modelValue: true,
|
|
122
128
|
},
|
|
123
129
|
})
|
|
124
130
|
|
|
@@ -130,5 +136,8 @@ describe('VSnackbar.ts', () => {
|
|
|
130
136
|
if (timeout === 0) {
|
|
131
137
|
expect(`[Vuetify] [UPGRADE] 'timeout="0"' is deprecated, use '-1' instead.`).toHaveBeenTipped()
|
|
132
138
|
}
|
|
139
|
+
|
|
140
|
+
spy.mockRestore()
|
|
141
|
+
jest.useRealTimers()
|
|
133
142
|
})
|
|
134
143
|
})
|
|
@@ -150,21 +150,16 @@ export default baseMixins.extend({
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
if (!this.isVertical) {
|
|
153
|
-
contentData.directives = [
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
contentData.directives = [
|
|
154
|
+
[
|
|
155
|
+
vShow,
|
|
156
|
+
this.isActive,
|
|
157
|
+
],
|
|
158
|
+
]
|
|
157
159
|
}
|
|
158
160
|
|
|
159
161
|
const wrapper = h('div', wrapperData, getSlot(this))
|
|
160
|
-
const content =
|
|
161
|
-
h('div', contentData, [wrapper]), this.isVertical ? [] :
|
|
162
|
-
[
|
|
163
|
-
[
|
|
164
|
-
vShow,
|
|
165
|
-
this.isActive
|
|
166
|
-
]
|
|
167
|
-
])
|
|
162
|
+
const content = h('div', contentData, [wrapper])
|
|
168
163
|
|
|
169
164
|
return h(this.computedTransition, {
|
|
170
165
|
...this.$listeners,
|
|
@@ -4,14 +4,14 @@ import VStepper from '../VStepper'
|
|
|
4
4
|
// Utilities
|
|
5
5
|
import {
|
|
6
6
|
mount,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
MountingOptions,
|
|
8
|
+
VueWrapper,
|
|
9
9
|
enableAutoUnmount,
|
|
10
10
|
} from '@vue/test-utils'
|
|
11
11
|
|
|
12
12
|
describe('VStepper.ts', () => {
|
|
13
13
|
type Instance = InstanceType<typeof VStepper>
|
|
14
|
-
let mountFunction: (options?:
|
|
14
|
+
let mountFunction: (options?: MountingOptions<Instance>) => VueWrapper<Instance>
|
|
15
15
|
|
|
16
16
|
enableAutoUnmount(afterEach)
|
|
17
17
|
|
|
@@ -54,12 +54,14 @@ describe('VStepperContent.ts', () => {
|
|
|
54
54
|
expect(wrapper.vm.isActive).toBeNull()
|
|
55
55
|
expect(wrapper.vm.height).toBe(0)
|
|
56
56
|
|
|
57
|
+
await wrapper.vm.$nextTick()
|
|
57
58
|
await wrapper.setData({ isActive: true })
|
|
59
|
+
await wrapper.vm.$nextTick()
|
|
58
60
|
expect(wrapper.vm.isActive).toBe(true)
|
|
59
61
|
expect(wrapper.vm.height).toBe('auto')
|
|
60
62
|
})
|
|
61
63
|
|
|
62
|
-
it('should use reverse transition', () => {
|
|
64
|
+
it('should use reverse transition', async () => {
|
|
63
65
|
const wrapper = mountFunction({
|
|
64
66
|
props: { step: 1 },
|
|
65
67
|
global: {
|
|
@@ -74,11 +76,12 @@ describe('VStepperContent.ts', () => {
|
|
|
74
76
|
})
|
|
75
77
|
expect(wrapper.vm.computedTransition).toBe(VTabTransition)
|
|
76
78
|
|
|
77
|
-
wrapper.setData({ isReverse: true })
|
|
79
|
+
await wrapper.setData({ isReverse: true })
|
|
80
|
+
await wrapper.vm.$nextTick()
|
|
78
81
|
expect(wrapper.vm.computedTransition).toBe(VTabReverseTransition)
|
|
79
82
|
})
|
|
80
83
|
|
|
81
|
-
it('should use opposite of reverse transition in rtl', () => {
|
|
84
|
+
it('should use opposite of reverse transition in rtl', async () => {
|
|
82
85
|
const wrapper = mountFunction({
|
|
83
86
|
global: {
|
|
84
87
|
mocks: {
|
|
@@ -98,7 +101,8 @@ describe('VStepperContent.ts', () => {
|
|
|
98
101
|
})
|
|
99
102
|
expect(wrapper.vm.computedTransition).toBe(VTabReverseTransition)
|
|
100
103
|
|
|
101
|
-
wrapper.setData({ isReverse: true })
|
|
104
|
+
await wrapper.setData({ isReverse: true })
|
|
105
|
+
await wrapper.vm.$nextTick()
|
|
102
106
|
expect(wrapper.vm.computedTransition).toBe(VTabTransition)
|
|
103
107
|
})
|
|
104
108
|
|
|
@@ -128,6 +132,7 @@ describe('VStepperContent.ts', () => {
|
|
|
128
132
|
isActive: true,
|
|
129
133
|
isVertical: true,
|
|
130
134
|
})
|
|
135
|
+
await wrapper.vm.$nextTick()
|
|
131
136
|
|
|
132
137
|
const stepWrapper = wrapper.find('.v-stepper__wrapper')
|
|
133
138
|
|
|
@@ -135,9 +140,11 @@ describe('VStepperContent.ts', () => {
|
|
|
135
140
|
|
|
136
141
|
// should call leave() -- total so far: 1
|
|
137
142
|
await wrapper.setData({ isActive: false })
|
|
143
|
+
await wrapper.vm.$nextTick()
|
|
138
144
|
|
|
139
145
|
// should call enter() -- total so far: 1
|
|
140
146
|
await wrapper.setData({ isActive: true })
|
|
147
|
+
await wrapper.vm.$nextTick()
|
|
141
148
|
|
|
142
149
|
expect(enter).toHaveBeenCalled()
|
|
143
150
|
expect(leave).toHaveBeenCalled()
|
|
@@ -149,13 +156,16 @@ describe('VStepperContent.ts', () => {
|
|
|
149
156
|
await wrapper.setData({
|
|
150
157
|
isVertical: false,
|
|
151
158
|
})
|
|
159
|
+
await wrapper.vm.$nextTick()
|
|
152
160
|
await wrapper.setData({ isActive: false })
|
|
161
|
+
await wrapper.vm.$nextTick()
|
|
153
162
|
await wrapper.setData({ isActive: true })
|
|
163
|
+
await wrapper.vm.$nextTick()
|
|
154
164
|
expect(enter.mock.calls).toHaveLength(1)
|
|
155
165
|
expect(leave.mock.calls).toHaveLength(1)
|
|
156
166
|
})
|
|
157
167
|
|
|
158
|
-
it('should toggle isActive state', () => {
|
|
168
|
+
it('should toggle isActive state', async () => {
|
|
159
169
|
const wrapper = mountFunction({
|
|
160
170
|
props: { step: 1 },
|
|
161
171
|
global: {
|
|
@@ -170,16 +180,19 @@ describe('VStepperContent.ts', () => {
|
|
|
170
180
|
})
|
|
171
181
|
|
|
172
182
|
wrapper.vm.toggle(1, false)
|
|
183
|
+
await wrapper.vm.$nextTick()
|
|
173
184
|
|
|
174
185
|
expect(wrapper.vm.isActive).toBe(true)
|
|
175
186
|
expect(wrapper.vm.isReverse).toBe(false)
|
|
176
187
|
|
|
177
188
|
wrapper.vm.toggle('1', false)
|
|
189
|
+
await wrapper.vm.$nextTick()
|
|
178
190
|
|
|
179
191
|
expect(wrapper.vm.isActive).toBe(true)
|
|
180
192
|
expect(wrapper.vm.isReverse).toBe(false)
|
|
181
193
|
|
|
182
194
|
wrapper.vm.toggle(2, true)
|
|
195
|
+
await wrapper.vm.$nextTick()
|
|
183
196
|
|
|
184
197
|
expect(wrapper.vm.isActive).toBe(false)
|
|
185
198
|
expect(wrapper.vm.isReverse).toBe(true)
|
|
@@ -266,10 +279,12 @@ describe('VStepperContent.ts', () => {
|
|
|
266
279
|
expect(wrapper.vm.onTransition()).toBeUndefined()
|
|
267
280
|
|
|
268
281
|
await wrapper.setData({ isActive: true })
|
|
282
|
+
await wrapper.vm.$nextTick()
|
|
269
283
|
|
|
270
284
|
expect(wrapper.vm.height).toBe('auto')
|
|
271
285
|
|
|
272
286
|
await wrapper.setData({ height: 0 })
|
|
287
|
+
await wrapper.vm.$nextTick()
|
|
273
288
|
|
|
274
289
|
wrapper.vm.onTransition({ propertyName: 'foo' })
|
|
275
290
|
expect(wrapper.vm.height).toBe(0)
|
|
@@ -287,6 +302,10 @@ describe('VStepperContent.ts', () => {
|
|
|
287
302
|
},
|
|
288
303
|
},
|
|
289
304
|
})
|
|
290
|
-
|
|
305
|
+
|
|
306
|
+
expect(wrapper.vm).toBeDefined()
|
|
307
|
+
|
|
308
|
+
// Ожидаем предупреждение о том, что компонент должен использоваться внутри v-stepper
|
|
309
|
+
expect('[Vuetify] The v-stepper-content component must be used inside a v-stepper').toHaveBeenTipped()
|
|
291
310
|
})
|
|
292
311
|
})
|
|
@@ -5,8 +5,8 @@ exports[`VStepperStep.ts should accept a custom color 1`] = `
|
|
|
5
5
|
class="v-stepper__step v-stepper__step--inactive v-stepper__step--complete"
|
|
6
6
|
>
|
|
7
7
|
<span class="v-stepper__step__step pink">
|
|
8
|
-
<i
|
|
9
|
-
|
|
8
|
+
<i class="v-icon notranslate theme--light mdi mdi-check"
|
|
9
|
+
aria-hidden="true"
|
|
10
10
|
>
|
|
11
11
|
</i>
|
|
12
12
|
</span>
|
|
@@ -22,8 +22,8 @@ exports[`VStepperStep.ts should accept a custom css color 1`] = `
|
|
|
22
22
|
<span class="v-stepper__step__step"
|
|
23
23
|
style="background-color: rgb(170, 187, 204); border-color: #aabbcc;"
|
|
24
24
|
>
|
|
25
|
-
<i
|
|
26
|
-
|
|
25
|
+
<i class="v-icon notranslate theme--light mdi mdi-check"
|
|
26
|
+
aria-hidden="true"
|
|
27
27
|
>
|
|
28
28
|
</i>
|
|
29
29
|
</span>
|
|
@@ -49,8 +49,8 @@ exports[`VStepperStep.ts should render complete step 1`] = `
|
|
|
49
49
|
class="v-stepper__step v-stepper__step--inactive v-stepper__step--complete"
|
|
50
50
|
>
|
|
51
51
|
<span class="v-stepper__step__step primary">
|
|
52
|
-
<i
|
|
53
|
-
|
|
52
|
+
<i class="v-icon notranslate theme--light mdi mdi-check"
|
|
53
|
+
aria-hidden="true"
|
|
54
54
|
>
|
|
55
55
|
</i>
|
|
56
56
|
</span>
|
|
@@ -64,10 +64,9 @@ exports[`VStepperStep.ts should render editable step 1`] = `
|
|
|
64
64
|
class="v-stepper__step v-stepper__step--editable v-stepper__step--inactive v-stepper__step--complete"
|
|
65
65
|
>
|
|
66
66
|
<span class="v-stepper__step__step primary">
|
|
67
|
-
<i
|
|
68
|
-
|
|
67
|
+
<i class="v-icon notranslate theme--light material-icons"
|
|
68
|
+
aria-hidden="true"
|
|
69
69
|
>
|
|
70
|
-
$edit
|
|
71
70
|
</i>
|
|
72
71
|
</span>
|
|
73
72
|
<div class="v-stepper__label">
|
|
@@ -80,10 +79,9 @@ exports[`VStepperStep.ts should render step with error 1`] = `
|
|
|
80
79
|
class="v-stepper__step v-stepper__step--inactive v-stepper__step--error error--text"
|
|
81
80
|
>
|
|
82
81
|
<span class="v-stepper__step__step">
|
|
83
|
-
<i
|
|
84
|
-
|
|
82
|
+
<i class="v-icon notranslate theme--light mdi mdi-alert"
|
|
83
|
+
aria-hidden="true"
|
|
85
84
|
>
|
|
86
|
-
$error
|
|
87
85
|
</i>
|
|
88
86
|
</span>
|
|
89
87
|
<div class="v-stepper__label">
|
|
@@ -4,18 +4,15 @@ import VSwitch from '../VSwitch'
|
|
|
4
4
|
// Utilities
|
|
5
5
|
import {
|
|
6
6
|
mount,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
MountingOptions,
|
|
8
|
+
VueWrapper,
|
|
9
9
|
enableAutoUnmount,
|
|
10
10
|
} from '@vue/test-utils'
|
|
11
11
|
import { touch } from '../../../../test'
|
|
12
12
|
|
|
13
|
-
// Types
|
|
14
|
-
import { ExtractVue } from '../../../util/mixins'
|
|
15
|
-
|
|
16
13
|
describe('VSwitch.ts', () => {
|
|
17
|
-
type Instance =
|
|
18
|
-
let mountFunction: (options?:
|
|
14
|
+
type Instance = InstanceType<typeof VSwitch>
|
|
15
|
+
let mountFunction: (options?: MountingOptions<Instance>) => VueWrapper<Instance>
|
|
19
16
|
|
|
20
17
|
enableAutoUnmount(afterEach)
|
|
21
18
|
|
|
@@ -6,35 +6,34 @@ exports[`VSwitch.ts should render element with loader and match the snapshot 1`]
|
|
|
6
6
|
<div class="v-input__slot">
|
|
7
7
|
<div class="v-input--selection-controls__input">
|
|
8
8
|
<input aria-checked="false"
|
|
9
|
-
id="input-
|
|
9
|
+
id="input-29"
|
|
10
10
|
role="switch"
|
|
11
11
|
type="checkbox"
|
|
12
12
|
aria-disabled="false"
|
|
13
|
-
value
|
|
14
13
|
>
|
|
15
14
|
<div class="v-input--selection-controls__ripple">
|
|
16
15
|
</div>
|
|
17
|
-
<div class="v-input--switch__track
|
|
16
|
+
<div class="theme--light v-input--switch__track">
|
|
18
17
|
</div>
|
|
19
|
-
<div class="v-input--switch__thumb
|
|
20
|
-
<div
|
|
18
|
+
<div class="theme--light v-input--switch__thumb">
|
|
19
|
+
<div class="v-progress-circular v-progress-circular--visible v-progress-circular--indeterminate primary--text"
|
|
20
|
+
role="progressbar"
|
|
21
21
|
aria-valuemin="0"
|
|
22
22
|
aria-valuemax="100"
|
|
23
|
-
class="v-progress-circular v-progress-circular--indeterminate primary--text"
|
|
24
23
|
style="height: 16px; width: 16px;"
|
|
25
24
|
>
|
|
26
|
-
<svg
|
|
25
|
+
<svg style="transform: rotate(0deg);"
|
|
26
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
27
27
|
viewbox="22.857142857142858 22.857142857142858 45.714285714285715 45.714285714285715"
|
|
28
|
-
style="transform: rotate(0deg);"
|
|
29
28
|
>
|
|
30
|
-
<circle
|
|
29
|
+
<circle class="v-progress-circular__overlay"
|
|
30
|
+
fill="transparent"
|
|
31
31
|
cx="45.714285714285715"
|
|
32
32
|
cy="45.714285714285715"
|
|
33
33
|
r="20"
|
|
34
34
|
stroke-width="5.714285714285714"
|
|
35
35
|
stroke-dasharray="125.664"
|
|
36
36
|
stroke-dashoffset="125.66370614359172px"
|
|
37
|
-
class="v-progress-circular__overlay"
|
|
38
37
|
>
|
|
39
38
|
</circle>
|
|
40
39
|
</svg>
|
|
@@ -45,11 +44,8 @@ exports[`VSwitch.ts should render element with loader and match the snapshot 1`]
|
|
|
45
44
|
</div>
|
|
46
45
|
</div>
|
|
47
46
|
<div class="v-messages theme--light">
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
class="v-messages__wrapper"
|
|
51
|
-
>
|
|
52
|
-
</span>
|
|
47
|
+
<div class="v-messages__wrapper">
|
|
48
|
+
</div>
|
|
53
49
|
</div>
|
|
54
50
|
</div>
|
|
55
51
|
</div>
|
|
@@ -45,6 +45,10 @@ export default baseMixins.extend({
|
|
|
45
45
|
default: '',
|
|
46
46
|
},
|
|
47
47
|
alignWithTitle: Boolean,
|
|
48
|
+
allowDeselect: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false,
|
|
51
|
+
},
|
|
48
52
|
backgroundColor: String,
|
|
49
53
|
centerActive: Boolean,
|
|
50
54
|
centered: Boolean,
|
|
@@ -216,6 +220,7 @@ export default baseMixins.extend({
|
|
|
216
220
|
height: convertToUnit(this.height),
|
|
217
221
|
},
|
|
218
222
|
activeClass: this.activeClass,
|
|
223
|
+
allowDeselect: this.allowDeselect,
|
|
219
224
|
centerActive: this.centerActive,
|
|
220
225
|
dark: this.dark,
|
|
221
226
|
light: this.light,
|
|
@@ -250,4 +250,69 @@ describe('VTabs.ts', () => {
|
|
|
250
250
|
const emitted = wrapper.emitted('update:modelValue')
|
|
251
251
|
expect(emitted).toBeFalsy() // Не должно быть эмиттов при инициализации
|
|
252
252
|
})
|
|
253
|
+
|
|
254
|
+
it('should not close active tab when clicked (allowDeselect=false)', async () => {
|
|
255
|
+
const wrapper = mountFunction({
|
|
256
|
+
props: {
|
|
257
|
+
modelValue: 'first',
|
|
258
|
+
allowDeselect: false, // Запрещаем deselect
|
|
259
|
+
},
|
|
260
|
+
slots: {
|
|
261
|
+
default: () => [h('div', [
|
|
262
|
+
h(VTab, { tabValue: 'first' }, () => 'First Tab'),
|
|
263
|
+
h(VTab, { tabValue: 'second' }, () => 'Second Tab'),
|
|
264
|
+
])],
|
|
265
|
+
},
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
await wrapper.vm.$nextTick()
|
|
269
|
+
|
|
270
|
+
// Проверяем, что первая вкладка активна
|
|
271
|
+
expect(wrapper.vm.internalValue).toBe('first')
|
|
272
|
+
|
|
273
|
+
// Кликаем по активной вкладке (первой)
|
|
274
|
+
const tabs = wrapper.findAllComponents({ name: 'v-tab' })
|
|
275
|
+
const firstTab = tabs[0] // Первая вкладка должна быть активной
|
|
276
|
+
await firstTab.trigger('click')
|
|
277
|
+
|
|
278
|
+
// Проверяем, что значение не изменилось (вкладка осталась активной)
|
|
279
|
+
expect(wrapper.vm.internalValue).toBe('first')
|
|
280
|
+
|
|
281
|
+
// Проверяем, что не было эмиттов update:modelValue
|
|
282
|
+
const emitted = wrapper.emitted('update:modelValue')
|
|
283
|
+
expect(emitted).toBeFalsy()
|
|
284
|
+
})
|
|
285
|
+
|
|
286
|
+
it('should not close active tab when clicked (mandatory=true)', async () => {
|
|
287
|
+
// Тест для проверки, что при mandatory=true активная вкладка не закрывается
|
|
288
|
+
const wrapper = mountFunction({
|
|
289
|
+
props: {
|
|
290
|
+
modelValue: 'first',
|
|
291
|
+
optional: false, // mandatory=true
|
|
292
|
+
},
|
|
293
|
+
slots: {
|
|
294
|
+
default: () => [h('div', [
|
|
295
|
+
h(VTab, { tabValue: 'first' }, () => 'First Tab'),
|
|
296
|
+
h(VTab, { tabValue: 'second' }, () => 'Second Tab'),
|
|
297
|
+
])],
|
|
298
|
+
},
|
|
299
|
+
})
|
|
300
|
+
|
|
301
|
+
await wrapper.vm.$nextTick()
|
|
302
|
+
|
|
303
|
+
// Проверяем, что первая вкладка активна
|
|
304
|
+
expect(wrapper.vm.internalValue).toBe('first')
|
|
305
|
+
|
|
306
|
+
// Кликаем по активной вкладке (первой)
|
|
307
|
+
const tabs = wrapper.findAllComponents({ name: 'v-tab' })
|
|
308
|
+
const firstTab = tabs[0] // Первая вкладка должна быть активной
|
|
309
|
+
await firstTab.trigger('click')
|
|
310
|
+
|
|
311
|
+
// Проверяем, что значение не изменилось (вкладка осталась активной)
|
|
312
|
+
expect(wrapper.vm.internalValue).toBe('first')
|
|
313
|
+
|
|
314
|
+
// Проверяем, что не было эмиттов update:modelValue
|
|
315
|
+
const emitted = wrapper.emitted('update:modelValue')
|
|
316
|
+
expect(emitted).toBeFalsy()
|
|
317
|
+
})
|
|
253
318
|
})
|
|
@@ -85,7 +85,7 @@ export default baseMixins.extend({
|
|
|
85
85
|
},
|
|
86
86
|
},
|
|
87
87
|
|
|
88
|
-
emits: ['update:modelValue', 'blur', 'focus', 'keydown'],
|
|
88
|
+
emits: ['update:modelValue', 'blur', 'focus', 'keydown', 'click:clear'],
|
|
89
89
|
|
|
90
90
|
data: () => ({
|
|
91
91
|
badInput: false,
|
|
@@ -254,6 +254,7 @@ export default baseMixins.extend({
|
|
|
254
254
|
clearableCallback () {
|
|
255
255
|
this.$refs.input && this.$refs.input.focus()
|
|
256
256
|
this.$nextTick(() => this.internalValue = null)
|
|
257
|
+
this.$emit('click:clear')
|
|
257
258
|
},
|
|
258
259
|
genAppendSlot () {
|
|
259
260
|
const slot = []
|