@dimailn/vuetify 2.7.2-alpha27 → 2.7.2-alpha29

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.
Files changed (349) hide show
  1. package/dist/vuetify.js +1493 -325
  2. package/dist/vuetify.js.map +1 -1
  3. package/dist/vuetify.min.css +1 -1
  4. package/dist/vuetify.min.js +2 -2
  5. package/es5/components/VAlert/VAlert.js +38 -9
  6. package/es5/components/VAlert/VAlert.js.map +1 -1
  7. package/es5/components/VAutocomplete/VAutocomplete.js +1 -0
  8. package/es5/components/VAutocomplete/VAutocomplete.js.map +1 -1
  9. package/es5/components/VBadge/VBadge.js +28 -0
  10. package/es5/components/VBadge/VBadge.js.map +1 -1
  11. package/es5/components/VBanner/VBanner.js +34 -6
  12. package/es5/components/VBanner/VBanner.js.map +1 -1
  13. package/es5/components/VBottomNavigation/VBottomNavigation.js +25 -0
  14. package/es5/components/VBottomNavigation/VBottomNavigation.js.map +1 -1
  15. package/es5/components/VCarousel/VCarousel.js +28 -3
  16. package/es5/components/VCarousel/VCarousel.js.map +1 -1
  17. package/es5/components/VCheckbox/VSimpleCheckbox.js +30 -2
  18. package/es5/components/VCheckbox/VSimpleCheckbox.js.map +1 -1
  19. package/es5/components/VChip/VChip.js +1 -0
  20. package/es5/components/VChip/VChip.js.map +1 -1
  21. package/es5/components/VColorPicker/VColorPicker.js +30 -2
  22. package/es5/components/VColorPicker/VColorPicker.js.map +1 -1
  23. package/es5/components/VCombobox/VCombobox.js +1 -0
  24. package/es5/components/VCombobox/VCombobox.js.map +1 -1
  25. package/es5/components/VDataIterator/VDataFooter.js +16 -7
  26. package/es5/components/VDataIterator/VDataFooter.js.map +1 -1
  27. package/es5/components/VDataIterator/VDataIterator.js +42 -47
  28. package/es5/components/VDataIterator/VDataIterator.js.map +1 -1
  29. package/es5/components/VDataTable/RowGroup.js +46 -15
  30. package/es5/components/VDataTable/RowGroup.js.map +1 -1
  31. package/es5/components/VDataTable/VDataTable.js +10 -18
  32. package/es5/components/VDataTable/VDataTable.js.map +1 -1
  33. package/es5/components/VDataTable/VDataTableHeader.js.map +1 -1
  34. package/es5/components/VDataTable/VDataTableHeaderDesktop.js +3 -0
  35. package/es5/components/VDataTable/VDataTableHeaderDesktop.js.map +1 -1
  36. package/es5/components/VDataTable/VDataTableHeaderMobile.js +28 -37
  37. package/es5/components/VDataTable/VDataTableHeaderMobile.js.map +1 -1
  38. package/es5/components/VDataTable/VEditDialog.js +3 -4
  39. package/es5/components/VDataTable/VEditDialog.js.map +1 -1
  40. package/es5/components/VDataTable/VSimpleTable.js +1 -1
  41. package/es5/components/VDataTable/VSimpleTable.js.map +1 -1
  42. package/es5/components/VDataTable/VVirtualTable.js +5 -5
  43. package/es5/components/VDataTable/VVirtualTable.js.map +1 -1
  44. package/es5/components/VDataTable/mixins/header.js +1 -1
  45. package/es5/components/VDataTable/mixins/header.js.map +1 -1
  46. package/es5/components/VDatePicker/VDatePicker.js +21 -9
  47. package/es5/components/VDatePicker/VDatePicker.js.map +1 -1
  48. package/es5/components/VDatePicker/VDatePickerHeader.js +24 -8
  49. package/es5/components/VDatePicker/VDatePickerHeader.js.map +1 -1
  50. package/es5/components/VDatePicker/VDatePickerTitle.js +33 -8
  51. package/es5/components/VDatePicker/VDatePickerTitle.js.map +1 -1
  52. package/es5/components/VDatePicker/VDatePickerYears.js +38 -13
  53. package/es5/components/VDatePicker/VDatePickerYears.js.map +1 -1
  54. package/es5/components/VDatePicker/mixins/date-picker-table.js +33 -17
  55. package/es5/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
  56. package/es5/components/VInput/VInput.js +36 -8
  57. package/es5/components/VInput/VInput.js.map +1 -1
  58. package/es5/components/VList/VListGroup.js +47 -21
  59. package/es5/components/VList/VListGroup.js.map +1 -1
  60. package/es5/components/VList/VListItem.js +33 -6
  61. package/es5/components/VList/VListItem.js.map +1 -1
  62. package/es5/components/VMenu/VMenu.js +56 -31
  63. package/es5/components/VMenu/VMenu.js.map +1 -1
  64. package/es5/components/VMessages/VMessages.js +30 -7
  65. package/es5/components/VMessages/VMessages.js.map +1 -1
  66. package/es5/components/VNavigationDrawer/VNavigationDrawer.js +36 -9
  67. package/es5/components/VNavigationDrawer/VNavigationDrawer.js.map +1 -1
  68. package/es5/components/VOtpInput/VOtpInput.js +36 -0
  69. package/es5/components/VOtpInput/VOtpInput.js.map +1 -1
  70. package/es5/components/VOverlay/VOverlay.js +28 -0
  71. package/es5/components/VOverlay/VOverlay.js.map +1 -1
  72. package/es5/components/VPagination/VPagination.js +30 -6
  73. package/es5/components/VPagination/VPagination.js.map +1 -1
  74. package/es5/components/VProgressLinear/VProgressLinear.js +28 -0
  75. package/es5/components/VProgressLinear/VProgressLinear.js.map +1 -1
  76. package/es5/components/VRadioGroup/VRadioGroup.js +28 -0
  77. package/es5/components/VRadioGroup/VRadioGroup.js.map +1 -1
  78. package/es5/components/VRating/VRating.js +45 -17
  79. package/es5/components/VRating/VRating.js.map +1 -1
  80. package/es5/components/VSelect/VSelect.js +112 -84
  81. package/es5/components/VSelect/VSelect.js.map +1 -1
  82. package/es5/components/VSelect/VSelectList.js +73 -19
  83. package/es5/components/VSelect/VSelectList.js.map +1 -1
  84. package/es5/components/VSlider/VSlider.js +42 -16
  85. package/es5/components/VSlider/VSlider.js.map +1 -1
  86. package/es5/components/VSpeedDial/VSpeedDial.js +10 -8
  87. package/es5/components/VSpeedDial/VSpeedDial.js.map +1 -1
  88. package/es5/components/VTabs/VTabs.js +45 -17
  89. package/es5/components/VTabs/VTabs.js.map +1 -1
  90. package/es5/components/VTooltip/VTooltip.js +3 -3
  91. package/es5/components/VTooltip/VTooltip.js.map +1 -1
  92. package/es5/components/VTreeview/VTreeview.js +0 -7
  93. package/es5/components/VTreeview/VTreeview.js.map +1 -1
  94. package/es5/framework.js +1 -1
  95. package/es5/mixins/routable/index.js +5 -2
  96. package/es5/mixins/routable/index.js.map +1 -1
  97. package/es5/mixins/validatable/index.js +24 -0
  98. package/es5/mixins/validatable/index.js.map +1 -1
  99. package/es5/util/console.js +49 -18
  100. package/es5/util/console.js.map +1 -1
  101. package/es5/util/helpers.js +5 -1
  102. package/es5/util/helpers.js.map +1 -1
  103. package/lib/components/VAlert/VAlert.js +12 -7
  104. package/lib/components/VAlert/VAlert.js.map +1 -1
  105. package/lib/components/VAutocomplete/VAutocomplete.js +1 -0
  106. package/lib/components/VAutocomplete/VAutocomplete.js.map +1 -1
  107. package/lib/components/VBadge/VBadge.js +11 -0
  108. package/lib/components/VBadge/VBadge.js.map +1 -1
  109. package/lib/components/VBanner/VBanner.js +11 -0
  110. package/lib/components/VBanner/VBanner.js.map +1 -1
  111. package/lib/components/VBottomNavigation/VBottomNavigation.js +7 -0
  112. package/lib/components/VBottomNavigation/VBottomNavigation.js.map +1 -1
  113. package/lib/components/VCarousel/VCarousel.js +7 -0
  114. package/lib/components/VCarousel/VCarousel.js.map +1 -1
  115. package/lib/components/VCheckbox/VSimpleCheckbox.js +11 -0
  116. package/lib/components/VCheckbox/VSimpleCheckbox.js.map +1 -1
  117. package/lib/components/VChip/VChip.js +1 -0
  118. package/lib/components/VChip/VChip.js.map +1 -1
  119. package/lib/components/VColorPicker/VColorPicker.js +12 -1
  120. package/lib/components/VColorPicker/VColorPicker.js.map +1 -1
  121. package/lib/components/VCombobox/VCombobox.js +1 -0
  122. package/lib/components/VCombobox/VCombobox.js.map +1 -1
  123. package/lib/components/VDataIterator/VDataFooter.js +14 -7
  124. package/lib/components/VDataIterator/VDataFooter.js.map +1 -1
  125. package/lib/components/VDataIterator/VDataIterator.js +26 -31
  126. package/lib/components/VDataIterator/VDataIterator.js.map +1 -1
  127. package/lib/components/VDataTable/RowGroup.js +30 -14
  128. package/lib/components/VDataTable/RowGroup.js.map +1 -1
  129. package/lib/components/VDataTable/VDataTable.js +8 -15
  130. package/lib/components/VDataTable/VDataTable.js.map +1 -1
  131. package/lib/components/VDataTable/VDataTableHeader.js +1 -1
  132. package/lib/components/VDataTable/VDataTableHeader.js.map +1 -1
  133. package/lib/components/VDataTable/VDataTableHeaderDesktop.js +3 -0
  134. package/lib/components/VDataTable/VDataTableHeaderDesktop.js.map +1 -1
  135. package/lib/components/VDataTable/VDataTableHeaderMobile.js +17 -25
  136. package/lib/components/VDataTable/VDataTableHeaderMobile.js.map +1 -1
  137. package/lib/components/VDataTable/VEditDialog.js +3 -4
  138. package/lib/components/VDataTable/VEditDialog.js.map +1 -1
  139. package/lib/components/VDataTable/VSimpleTable.js +1 -1
  140. package/lib/components/VDataTable/VSimpleTable.js.map +1 -1
  141. package/lib/components/VDataTable/VVirtualTable.js +1 -2
  142. package/lib/components/VDataTable/VVirtualTable.js.map +1 -1
  143. package/lib/components/VDataTable/mixins/header.js +1 -1
  144. package/lib/components/VDataTable/mixins/header.js.map +1 -1
  145. package/lib/components/VDatePicker/VDatePicker.js +7 -1
  146. package/lib/components/VDatePicker/VDatePicker.js.map +1 -1
  147. package/lib/components/VDatePicker/VDatePickerHeader.js +12 -1
  148. package/lib/components/VDatePicker/VDatePickerHeader.js.map +1 -1
  149. package/lib/components/VDatePicker/VDatePickerTitle.js +11 -0
  150. package/lib/components/VDatePicker/VDatePickerTitle.js.map +1 -1
  151. package/lib/components/VDatePicker/VDatePickerYears.js +11 -1
  152. package/lib/components/VDatePicker/VDatePickerYears.js.map +1 -1
  153. package/lib/components/VDatePicker/mixins/date-picker-table.js +12 -1
  154. package/lib/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
  155. package/lib/components/VInput/VInput.js +13 -3
  156. package/lib/components/VInput/VInput.js.map +1 -1
  157. package/lib/components/VList/VListGroup.js +16 -8
  158. package/lib/components/VList/VListGroup.js.map +1 -1
  159. package/lib/components/VList/VListItem.js +12 -3
  160. package/lib/components/VList/VListItem.js.map +1 -1
  161. package/lib/components/VMenu/VMenu.js +15 -4
  162. package/lib/components/VMenu/VMenu.js.map +1 -1
  163. package/lib/components/VMessages/VMessages.js +13 -2
  164. package/lib/components/VMessages/VMessages.js.map +1 -1
  165. package/lib/components/VNavigationDrawer/VNavigationDrawer.js +11 -2
  166. package/lib/components/VNavigationDrawer/VNavigationDrawer.js.map +1 -1
  167. package/lib/components/VOtpInput/VOtpInput.js +48 -0
  168. package/lib/components/VOtpInput/VOtpInput.js.map +1 -1
  169. package/lib/components/VOverlay/VOverlay.js +11 -0
  170. package/lib/components/VOverlay/VOverlay.js.map +1 -1
  171. package/lib/components/VPagination/VPagination.js +11 -0
  172. package/lib/components/VPagination/VPagination.js.map +1 -1
  173. package/lib/components/VProgressLinear/VProgressLinear.js +11 -0
  174. package/lib/components/VProgressLinear/VProgressLinear.js.map +1 -1
  175. package/lib/components/VRadioGroup/VRadioGroup.js +11 -0
  176. package/lib/components/VRadioGroup/VRadioGroup.js.map +1 -1
  177. package/lib/components/VRating/VRating.js +11 -0
  178. package/lib/components/VRating/VRating.js.map +1 -1
  179. package/lib/components/VSelect/VSelect.js +52 -36
  180. package/lib/components/VSelect/VSelect.js.map +1 -1
  181. package/lib/components/VSelect/VSelectList.js +32 -8
  182. package/lib/components/VSelect/VSelectList.js.map +1 -1
  183. package/lib/components/VSlider/VSlider.js +11 -1
  184. package/lib/components/VSlider/VSlider.js.map +1 -1
  185. package/lib/components/VSpeedDial/VSpeedDial.js +7 -7
  186. package/lib/components/VSpeedDial/VSpeedDial.js.map +1 -1
  187. package/lib/components/VTabs/VTabs.js +11 -0
  188. package/lib/components/VTabs/VTabs.js.map +1 -1
  189. package/lib/components/VTooltip/VTooltip.js +3 -3
  190. package/lib/components/VTooltip/VTooltip.js.map +1 -1
  191. package/lib/components/VTreeview/VTreeview.js +0 -6
  192. package/lib/components/VTreeview/VTreeview.js.map +1 -1
  193. package/lib/framework.js +1 -1
  194. package/lib/mixins/routable/index.js +5 -2
  195. package/lib/mixins/routable/index.js.map +1 -1
  196. package/lib/mixins/validatable/index.js +7 -1
  197. package/lib/mixins/validatable/index.js.map +1 -1
  198. package/lib/util/console.js +47 -17
  199. package/lib/util/console.js.map +1 -1
  200. package/lib/util/helpers.js +5 -1
  201. package/lib/util/helpers.js.map +1 -1
  202. package/package.json +1 -1
  203. package/src/components/VAlert/VAlert.ts +17 -8
  204. package/src/components/VAlert/__tests__/VAlert.spec.ts +78 -50
  205. package/src/components/VAlert/__tests__/__snapshots__/VAlert.spec.ts.snap +16 -18
  206. package/src/components/VApp/__tests__/VApp.spec.ts +24 -18
  207. package/src/components/VApp/__tests__/__snapshots__/VApp.spec.ts.snap +4 -4
  208. package/src/components/VAppBar/__tests__/VAppBar.spec.ts +256 -74
  209. package/src/components/VAppBar/__tests__/VAppBarNavIcon.spec.ts +2 -6
  210. package/src/components/VAppBar/__tests__/__snapshots__/VAppBar.spec.ts.snap +13 -4
  211. package/src/components/VAppBar/__tests__/__snapshots__/VAppBarNavIcon.spec.ts.snap +3 -4
  212. package/src/components/VAutocomplete/VAutocomplete.ts +22 -0
  213. package/src/components/VAutocomplete/__tests__/VAutocomplete.spec.ts +51 -53
  214. package/src/components/VAutocomplete/__tests__/VAutocomplete2.spec.ts +77 -48
  215. package/src/components/VAutocomplete/__tests__/VAutocomplete3.spec.ts +101 -39
  216. package/src/components/VBadge/VBadge.ts +13 -0
  217. package/src/components/VBanner/VBanner.ts +13 -0
  218. package/src/components/VBanner/__tests__/VBanner.spec.ts +35 -36
  219. package/src/components/VBanner/__tests__/__snapshots__/VBanner.spec.ts.snap +1 -1
  220. package/src/components/VBottomNavigation/VBottomNavigation.ts +10 -0
  221. package/src/components/VBtn/__tests__/VBtn.spec.ts +1 -1
  222. package/src/components/VCard/__tests__/VCard.spec.ts +46 -28
  223. package/src/components/VCard/__tests__/__snapshots__/VCard.spec.ts.snap +2 -2
  224. package/src/components/VCarousel/VCarousel.ts +11 -0
  225. package/src/components/VCheckbox/VSimpleCheckbox.ts +13 -0
  226. package/src/components/VCheckbox/__tests__/VCheckbox.spec.ts +157 -152
  227. package/src/components/VChip/VChip.ts +1 -0
  228. package/src/components/VChip/__tests__/VChip.spec.ts +50 -50
  229. package/src/components/VChip/__tests__/__snapshots__/VChip.spec.ts.snap +4 -4
  230. package/src/components/VChipGroup/__tests__/VChipGroup.spec.ts +14 -21
  231. package/src/components/VColorPicker/VColorPicker.ts +13 -0
  232. package/src/components/VColorPicker/__tests__/__snapshots__/VColorPicker.spec.ts.snap +35 -35
  233. package/src/components/VColorPicker/__tests__/__snapshots__/VColorPickerEdit.spec.ts.snap +10 -10
  234. package/src/components/VCombobox/VCombobox.ts +23 -0
  235. package/src/components/VCombobox/__tests__/VCombobox-multiple.spec.ts +118 -110
  236. package/src/components/VCombobox/__tests__/VCombobox.spec.ts +119 -93
  237. package/src/components/VData/__tests__/VData.spec.ts +69 -90
  238. package/src/components/VDataIterator/VDataFooter.ts +14 -9
  239. package/src/components/VDataIterator/VDataIterator.ts +46 -34
  240. package/src/components/VDataIterator/__tests__/VDataFooter.spec.ts +38 -39
  241. package/src/components/VDataIterator/__tests__/VDataIterator.spec.ts +90 -122
  242. package/src/components/VDataIterator/__tests__/__snapshots__/VDataFooter.spec.ts.snap +92 -82
  243. package/src/components/VDataIterator/__tests__/__snapshots__/VDataIterator.spec.ts.snap +79 -69
  244. package/src/components/VDataTable/RowGroup.ts +33 -16
  245. package/src/components/VDataTable/VDataTable.ts +8 -15
  246. package/src/components/VDataTable/VDataTableHeader.ts +2 -2
  247. package/src/components/VDataTable/VDataTableHeaderDesktop.ts +4 -0
  248. package/src/components/VDataTable/VDataTableHeaderMobile.ts +16 -25
  249. package/src/components/VDataTable/VEditDialog.ts +3 -3
  250. package/src/components/VDataTable/VSimpleTable.ts +2 -3
  251. package/src/components/VDataTable/VVirtualTable.ts +1 -2
  252. package/src/components/VDataTable/__tests__/MobileRow.spec.ts +55 -66
  253. package/src/components/VDataTable/__tests__/Row.spec.ts +64 -73
  254. package/src/components/VDataTable/__tests__/RowGroup.spec.ts +7 -5
  255. package/src/components/VDataTable/__tests__/VDataTable.spec.ts +916 -998
  256. package/src/components/VDataTable/__tests__/VDataTableHeader.spec.ts +39 -29
  257. package/src/components/VDataTable/__tests__/VEditDialog.spec.ts +33 -24
  258. package/src/components/VDataTable/__tests__/VSimpleTable.spec.ts +55 -29
  259. package/src/components/VDataTable/__tests__/VVirtualTable.spec.ts +13 -15
  260. package/src/components/VDataTable/__tests__/__snapshots__/Row.spec.ts.snap +30 -0
  261. package/src/components/VDataTable/__tests__/__snapshots__/VDataTable.spec.ts.snap +2543 -2086
  262. package/src/components/VDataTable/__tests__/__snapshots__/VDataTableHeader.spec.ts.snap +115 -144
  263. package/src/components/VDataTable/__tests__/__snapshots__/VEditDialog.spec.ts.snap +6 -6
  264. package/src/components/VDataTable/__tests__/__snapshots__/VSimpleTable.spec.ts.snap +22 -18
  265. package/src/components/VDataTable/mixins/__tests__/__snapshots__/header.spec.ts.snap +10 -13
  266. package/src/components/VDataTable/mixins/__tests__/header.spec.ts +15 -15
  267. package/src/components/VDataTable/mixins/header.ts +1 -1
  268. package/src/components/VDatePicker/VDatePicker.ts +11 -1
  269. package/src/components/VDatePicker/VDatePickerHeader.ts +13 -0
  270. package/src/components/VDatePicker/VDatePickerTitle.ts +12 -0
  271. package/src/components/VDatePicker/VDatePickerYears.ts +13 -0
  272. package/src/components/VDatePicker/mixins/date-picker-table.ts +13 -0
  273. package/src/components/VDivider/__tests__/VDivider.spec.ts +11 -15
  274. package/src/components/VDivider/__tests__/__snapshots__/VDivider.spec.ts.snap +2 -2
  275. package/src/components/VGrid/__tests__/VCol.spec.ts +17 -17
  276. package/src/components/VGrid/__tests__/VContainer.spec.ts +58 -3
  277. package/src/components/VGrid/__tests__/VFlex.spec.ts +3 -3
  278. package/src/components/VGrid/__tests__/VGrid.spec.ts +12 -10
  279. package/src/components/VGrid/__tests__/VLayout.spec.ts +3 -3
  280. package/src/components/VIcon/__tests__/VIcon.spec.ts +176 -70
  281. package/src/components/VImg/__tests__/__snapshots__/VImg.spec.ts.snap +55 -55
  282. package/src/components/VInput/VInput.ts +18 -5
  283. package/src/components/VItemGroup/__tests__/VItem.spec.ts +22 -37
  284. package/src/components/VItemGroup/__tests__/VItemGroup.spec.ts +96 -124
  285. package/src/components/VItemGroup/__tests__/__snapshots__/VItem.spec.ts.snap +2 -0
  286. package/src/components/VLabel/__tests__/VLabel.spec.ts +240 -14
  287. package/src/components/VLazy/__tests__/VLazy.spec.ts +5 -4
  288. package/src/components/VLazy/__tests__/__snapshots__/VLazy.spec.ts.snap +2 -1
  289. package/src/components/VList/VListGroup.ts +22 -10
  290. package/src/components/VList/VListItem.ts +19 -4
  291. package/src/components/VList/__tests__/VList.spec.ts +13 -12
  292. package/src/components/VList/__tests__/VListGroup.spec.ts +59 -51
  293. package/src/components/VList/__tests__/VListItem.spec.ts +142 -63
  294. package/src/components/VList/__tests__/VListItemAvatar.spec.ts +5 -2
  295. package/src/components/VList/__tests__/VListItemGroup.spec.ts +5 -2
  296. package/src/components/VList/__tests__/__snapshots__/VList.spec.ts.snap +10 -10
  297. package/src/components/VList/__tests__/__snapshots__/VListGroup.spec.ts.snap +5 -6
  298. package/src/components/VList/__tests__/__snapshots__/VListItem.spec.ts.snap +1 -1
  299. package/src/components/VMain/__tests__/VMain.spec.ts +71 -17
  300. package/src/components/VMenu/VMenu.ts +22 -4
  301. package/src/components/VMenu/__tests__/VMenu.spec.ts +90 -69
  302. package/src/components/VMenu/__tests__/__snapshots__/VMenu.spec.ts.snap +3 -5
  303. package/src/components/VMessages/VMessages.ts +15 -4
  304. package/src/components/VMessages/__tests__/VMessages.spec.ts +55 -16
  305. package/src/components/VMessages/__tests__/__snapshots__/VMessages.spec.ts.snap +16 -25
  306. package/src/components/VNavigationDrawer/VNavigationDrawer.ts +21 -11
  307. package/src/components/VOtpInput/VOtpInput.ts +37 -1
  308. package/src/components/VOverlay/VOverlay.ts +12 -0
  309. package/src/components/VPagination/VPagination.ts +23 -9
  310. package/src/components/VParallax/__tests__/__snapshots__/VParallax.spec.ts.snap +8 -8
  311. package/src/components/VPicker/__tests__/__snapshots__/VPicker.spec.ts.snap +2 -2
  312. package/src/components/VProgressLinear/VProgressLinear.ts +13 -0
  313. package/src/components/VRadioGroup/VRadioGroup.ts +14 -0
  314. package/src/components/VRating/VRating.ts +13 -0
  315. package/src/components/VResponsive/__tests__/__snapshots__/VResponsive.spec.ts.snap +2 -2
  316. package/src/components/VSelect/VSelect.ts +60 -43
  317. package/src/components/VSelect/VSelectList.ts +33 -12
  318. package/src/components/VSelect/__tests__/VSelect.spec.ts +166 -125
  319. package/src/components/VSelect/__tests__/VSelect2.spec.ts +127 -111
  320. package/src/components/VSelect/__tests__/VSelect3.spec.ts +109 -91
  321. package/src/components/VSelect/__tests__/VSelect4.spec.ts +79 -68
  322. package/src/components/VSelect/__tests__/VSelectList.spec.ts +23 -31
  323. package/src/components/VSelect/__tests__/__snapshots__/VSelect.spec.ts.snap +58 -62
  324. package/src/components/VSelect/__tests__/__snapshots__/VSelect2.spec.ts.snap +50 -62
  325. package/src/components/VSelect/__tests__/__snapshots__/VSelect3.spec.ts.snap +10 -14
  326. package/src/components/VSlider/VSlider.ts +14 -1
  327. package/src/components/VSparkline/__tests__/VSparkline.spec.ts +33 -35
  328. package/src/components/VSpeedDial/VSpeedDial.ts +7 -8
  329. package/src/components/VSpeedDial/__tests__/VSpeedDial.spec.ts +21 -13
  330. package/src/components/VSpeedDial/__tests__/__snapshots__/VSpeedDial.spec.ts.snap +6 -6
  331. package/src/components/VStepper/__tests__/VStepper.spec.ts +4 -1
  332. package/src/components/VStepper/__tests__/VStepperContent.spec.ts +104 -110
  333. package/src/components/VStepper/__tests__/VStepperStep.spec.ts +51 -44
  334. package/src/components/VSwitch/__tests__/VSwitch.spec.ts +30 -37
  335. package/src/components/VTabs/VTabs.ts +14 -0
  336. package/src/components/VTabs/__tests__/VTabs.spec.ts +0 -7
  337. package/src/components/VTextField/__tests__/VTextField.spec.ts +342 -246
  338. package/src/components/VTextarea/__tests__/VTextarea.spec.ts +112 -35
  339. package/src/components/VTimePicker/__tests__/__snapshots__/VTimePicker.spec.ts.snap +0 -40
  340. package/src/components/VToolbar/__tests__/VToolbar.spec.ts +49 -25
  341. package/src/components/VTooltip/VTooltip.ts +3 -3
  342. package/src/components/VTooltip/__tests__/__snapshots__/VTooltip.spec.ts.snap +34 -18
  343. package/src/components/VTreeview/VTreeview.ts +0 -5
  344. package/src/mixins/routable/index.ts +6 -4
  345. package/src/mixins/validatable/index.ts +11 -1
  346. package/src/util/__tests__/console.spec.ts +124 -11
  347. package/src/util/__tests__/helpers.spec.ts +59 -31
  348. package/src/util/console.ts +43 -24
  349. package/src/util/helpers.ts +8 -4
@@ -1,12 +1,13 @@
1
1
  import VDataTable from '../VDataTable'
2
2
  import {
3
3
  mount,
4
- Wrapper,
5
- MountOptions,
4
+ VueWrapper,
5
+ MountingOptions,
6
+ enableAutoUnmount,
6
7
  } from '@vue/test-utils'
8
+ import { h, nextTick } from 'vue'
7
9
  import { Breakpoint } from '../../../services/breakpoint'
8
10
  import ripple from '../../../directives/ripple/index'
9
- import Vue from 'vue'
10
11
  import { Lang } from '../../../services/lang'
11
12
  import { preset } from '../../../presets/default'
12
13
  import { resizeWindow } from '../../../../test'
@@ -121,27 +122,34 @@ const testItems = [
121
122
  /* eslint-disable max-statements */
122
123
  describe('VDataTable.ts', () => {
123
124
  type Instance = InstanceType<typeof VDataTable>
124
- let mountFunction: (options?: MountOptions<Instance>) => Wrapper<Instance>
125
+ let mountFunction: (options?: MountingOptions<Instance>) => VueWrapper<Instance>
126
+
127
+ enableAutoUnmount(afterEach)
128
+
125
129
  beforeEach(() => {
126
130
  document.body.setAttribute('data-app', 'true')
127
131
 
128
- mountFunction = (options?: MountOptions<Instance>) => {
132
+ mountFunction = (options?: MountingOptions<Instance>) => {
133
+ const vuetifyInstance = {
134
+ breakpoint: new Breakpoint(preset),
135
+ lang: new Lang(preset),
136
+ theme: {
137
+ dark: false,
138
+ },
139
+ icons: {},
140
+ }
141
+
129
142
  return mount(VDataTable, {
130
143
  global: {
131
144
  config: {
132
145
  globalProperties: {
133
- $vuetify: {
134
- breakpoint: new Breakpoint(preset),
135
- lang: new Lang(preset),
136
- theme: {
137
- dark: false,
138
- },
139
- icons: {}
140
- }
141
- }
142
- }
146
+ $vuetify: vuetifyInstance,
147
+ },
148
+ },
149
+ mocks: {
150
+ $vuetify: vuetifyInstance,
151
+ },
143
152
  },
144
- sync: false,
145
153
  ...options,
146
154
  })
147
155
  }
@@ -155,986 +163,896 @@ describe('VDataTable.ts', () => {
155
163
  expect(wrapper.html()).toMatchSnapshot()
156
164
  })
157
165
 
158
- // it('should render with data', () => {
159
- // const wrapper = mountFunction({
160
- // propsData: {
161
- // headers: testHeaders,
162
- // items: testItems,
163
- // itemsPerPage: 5,
164
- // },
165
- // })
166
-
167
- // expect(wrapper.html()).toMatchSnapshot()
168
- // })
169
-
170
- // it('should render with body slot', () => {
171
- // const wrapper = mountFunction({
172
- // propsData: {
173
- // headers: testHeaders,
174
- // items: testItems,
175
- // itemsPerPage: 5,
176
- // },
177
- // scopedSlots: {
178
- // body (props) {
179
- // return h('div', [props.items.length])
180
- // },
181
- // },
182
- // })
183
-
184
- // expect(wrapper.html()).toMatchSnapshot()
185
- // })
186
-
187
- // it('should render with foot slot', () => {
188
- // const wrapper = mountFunction({
189
- // propsData: {
190
- // headers: testHeaders,
191
- // items: testItems,
192
- // itemsPerPage: 5,
193
- // },
194
- // scopedSlots: {
195
- // foot (props) {
196
- // return h('tfoot', [props.items.length])
197
- // },
198
- // },
199
- // })
200
-
201
- // expect(wrapper.html()).toMatchSnapshot()
202
- // })
203
-
204
- // it.skip('should render virtual table', () => {
205
- // const wrapper = mountFunction({
206
- // propsData: {
207
- // headers: testHeaders,
208
- // items: testItems,
209
- // itemsPerPage: 5,
210
- // virtualRows: true,
211
- // },
212
- // })
213
-
214
- // expect(wrapper.html()).toMatchSnapshot()
215
- // })
216
-
217
- // it('should render with showExpand', async () => {
218
- // const expand = jest.fn()
219
- // const wrapper = mountFunction({
220
- // propsData: {
221
- // headers: testHeaders,
222
- // itemKey: 'name',
223
- // items: testItems,
224
- // itemsPerPage: 5,
225
- // showExpand: true,
226
- // },
227
- // listeners: {
228
- // 'update:expanded': expand,
229
- // },
230
- // })
231
-
232
- // expect(wrapper.html()).toMatchSnapshot()
233
- // const expandIcon = wrapper.findAll('.v-data-table__expand-icon').at(0)
234
- // expandIcon.trigger('click')
235
-
236
- // await wrapper.vm.$nextTick()
237
- // expect(expand).toHaveBeenCalledWith(testItems.slice(0, 1))
238
- // expect(wrapper.html()).toMatchSnapshot()
239
- // })
240
-
241
- // it('should render with showSelect', () => {
242
- // const wrapper = mountFunction({
243
- // propsData: {
244
- // headers: testHeaders,
245
- // items: testItems,
246
- // itemsPerPage: 5,
247
- // showSelect: true,
248
- // },
249
- // })
250
-
251
- // expect(wrapper.html()).toMatchSnapshot()
252
- // })
253
-
254
- // it('should render with item.expanded scoped slot', async () => {
255
- // const vm = new Vue()
256
-
257
- // const wrapper = mountFunction({
258
- // propsData: {
259
- // headers: testHeaders,
260
- // items: testItems,
261
- // itemsPerPage: 5,
262
- // expanded: testItems,
263
- // },
264
- // scopedSlots: {
265
- // 'expanded-item': props => vm.$createElement('div', ['expanded']),
266
- // },
267
- // })
268
-
269
- // await wrapper.vm.$nextTick()
270
-
271
- // expect(wrapper.html()).toMatchSnapshot()
272
- // })
273
-
274
- // it('should render with group.summary scoped slot', () => {
275
- // const vm = new Vue()
276
-
277
- // const wrapper = mountFunction({
278
- // propsData: {
279
- // headers: testHeaders,
280
- // items: testItems,
281
- // itemsPerPage: 5,
282
- // groupBy: 'calories',
283
- // },
284
- // scopedSlots: {
285
- // 'group.summary': props => vm.$createElement('div', ['summary']),
286
- // },
287
- // })
288
-
289
- // expect(wrapper.html()).toMatchSnapshot()
290
- // })
291
-
292
- // it('should render with item scoped slot', () => {
293
- // const vm = new Vue()
294
-
295
- // const wrapper = mountFunction({
296
- // propsData: {
297
- // headers: testHeaders,
298
- // items: testItems,
299
- // itemsPerPage: 5,
300
- // },
301
- // scopedSlots: {
302
- // item: props => vm.$createElement('div', [JSON.stringify(props)]),
303
- // },
304
- // })
305
-
306
- // expect(wrapper.html()).toMatchSnapshot()
307
- // })
308
-
309
- // it('should render with grouped rows', () => {
310
- // const wrapper = mountFunction({
311
- // propsData: {
312
- // headers: testHeaders,
313
- // items: testItems,
314
- // itemsPerPage: 5,
315
- // groupBy: ['protein'],
316
- // },
317
- // })
318
-
319
- // expect(wrapper.html()).toMatchSnapshot()
320
- // })
321
-
322
- // it('should render with group scoped slot', () => {
323
- // const vm = new Vue()
324
-
325
- // const wrapper = mountFunction({
326
- // propsData: {
327
- // headers: testHeaders,
328
- // items: testItems,
329
- // itemsPerPage: 5,
330
- // groupBy: ['protein'],
331
- // },
332
- // scopedSlots: {
333
- // group: props => vm.$createElement('div', [JSON.stringify(props)]),
334
- // },
335
- // })
336
-
337
- // expect(wrapper.html()).toMatchSnapshot()
338
- // })
339
-
340
- // it('should render loading state', () => {
341
- // const wrapper = mountFunction({
342
- // propsData: {
343
- // loading: true,
344
- // },
345
- // })
346
-
347
- // expect(wrapper.html()).toMatchSnapshot()
348
-
349
- // const wrapper2 = mountFunction({
350
- // propsData: {
351
- // headers: testHeaders,
352
- // loading: true,
353
- // },
354
- // slots: {
355
- // progress: '<div class="progress">50%</div>',
356
- // },
357
- // })
358
-
359
- // expect(wrapper2.html()).toMatchSnapshot()
360
- // })
361
-
362
- // it.each([
363
- // 'click',
364
- // 'contextmenu',
365
- // 'dblclick',
366
- // ])('should emit event when %sing on internally created row', async event => {
367
- // const eventToEmit = event + ':row'
368
- // const fn = jest.fn()
369
- // const wrapper = mountFunction({
370
- // propsData: {
371
- // headers: testHeaders,
372
- // items: testItems,
373
- // },
374
- // listeners: {
375
- // [eventToEmit]: fn,
376
- // },
377
- // })
378
-
379
- // wrapper.find('tbody tr').trigger(event)
380
- // await wrapper.vm.$nextTick()
381
-
382
- // expect(fn).toHaveBeenCalled()
383
- // })
384
-
385
- // // https://github.com/vuetifyjs/vuetify/issues/8254
386
- // it('should pass kebab-case footer props correctly', () => {
387
- // const wrapper = mountFunction({
388
- // propsData: {
389
- // headers: [],
390
- // items: [],
391
- // footerProps: {
392
- // 'items-per-page-text': 'Foo:',
393
- // },
394
- // },
395
- // })
396
-
397
- // expect(wrapper.html()).toMatchSnapshot()
398
- // })
399
-
400
- // // https://github.com/vuetifyjs/vuetify/issues/8266
401
- // it('should use options prop for initial values', () => {
402
- // const fn = jest.fn()
403
- // const wrapper = mountFunction({
404
- // propsData: {
405
- // headers: testHeaders,
406
- // items: testItems,
407
- // options: {
408
- // page: 2,
409
- // itemsPerPage: 5,
410
- // },
411
- // },
412
- // listeners: {
413
- // 'update:options': fn,
414
- // },
415
- // })
416
-
417
- // expect(fn).toHaveBeenCalledWith(expect.objectContaining({
418
- // page: 2,
419
- // }))
420
- // })
421
-
422
- // it('should render footer.prepend slot content', () => {
423
- // const wrapper = mountFunction({
424
- // propsData: {
425
- // headers: [],
426
- // items: [{}],
427
- // },
428
- // scopedSlots: {
429
- // 'footer.prepend' () {
430
- // return h('div', ['footer.prepend slot content'])
431
- // },
432
- // },
433
- // })
434
-
435
- // expect(wrapper.html()).toMatchSnapshot()
436
- // })
437
-
438
- // it('should render footer.page-text slot content', () => {
439
- // const wrapper = mountFunction({
440
- // propsData: {
441
- // headers: [],
442
- // items: [{}],
443
- // },
444
- // scopedSlots: {
445
- // 'footer.page-text' ({ pageStart, pageStop }) {
446
- // return h('div', [`foo ${pageStart} bar ${pageStop}`])
447
- // },
448
- // },
449
- // })
450
-
451
- // expect(wrapper.html()).toMatchSnapshot()
452
- // })
453
-
454
- // // https://github.com/vuetifyjs/vuetify/issues/8359
455
- // it('should not limit page to current item count when using server-items-length', async () => {
456
- // const wrapper = mountFunction({
457
- // propsData: {
458
- // headers: testHeaders,
459
- // items: [],
460
- // page: 2,
461
- // itemsPerPage: 5,
462
- // serverItemsLength: 0,
463
- // },
464
- // })
465
-
466
- // expect(wrapper.html()).toMatchSnapshot()
467
-
468
- // wrapper.setProps({
469
- // items: testItems.slice(5),
470
- // serverItemsLength: 20,
471
- // })
472
- // await wrapper.vm.$nextTick()
473
-
474
- // expect(wrapper.html()).toMatchSnapshot()
475
- // })
476
-
477
- // it('should not search column with filterable set to false', async () => {
478
- // const wrapper = mountFunction({
479
- // propsData: {
480
- // items: testItems,
481
- // headers: [
482
- // {
483
- // text: 'Dessert (100g serving)',
484
- // align: 'left',
485
- // filterable: false,
486
- // value: 'name',
487
- // },
488
- // { text: 'Calories', value: 'calories' },
489
- // { text: 'Fat (g)', value: 'fat' },
490
- // { text: 'Carbs (g)', value: 'carbs' },
491
- // { text: 'Protein (g)', value: 'protein' },
492
- // { text: 'Iron (%)', value: 'iron' },
493
- // ],
494
- // },
495
- // })
496
-
497
- // expect(wrapper.html()).toMatchSnapshot()
498
-
499
- // wrapper.setProps({
500
- // search: 'cup',
501
- // })
502
- // await wrapper.vm.$nextTick()
503
-
504
- // expect(wrapper.html()).toMatchSnapshot()
505
- // })
506
-
507
- // it('should not search column with filterable set to false and has filter function', async () => {
508
- // const wrapper = mountFunction({
509
- // propsData: {
510
- // items: testItems,
511
- // headers: [
512
- // {
513
- // text: 'Dessert (100g serving)',
514
- // align: 'left',
515
- // value: 'name',
516
- // },
517
- // { text: 'Calories', value: 'calories', filter: v => v > 400 },
518
- // { text: 'Fat (g)', value: 'fat' },
519
- // { text: 'Carbs (g)', value: 'carbs' },
520
- // { text: 'Protein (g)', value: 'protein' },
521
- // { text: 'Iron (%)', value: 'iron' },
522
- // ],
523
- // },
524
- // })
525
-
526
- // expect(wrapper.html()).toMatchSnapshot()
527
-
528
- // wrapper.setProps({
529
- // headers: [
530
- // {
531
- // text: 'Dessert (100g serving)',
532
- // align: 'left',
533
- // value: 'name',
534
- // },
535
- // { text: 'Calories', value: 'calories', filter: v => v > 400, filterable: false },
536
- // { text: 'Fat (g)', value: 'fat' },
537
- // { text: 'Carbs (g)', value: 'carbs' },
538
- // { text: 'Protein (g)', value: 'protein' },
539
- // { text: 'Iron (%)', value: 'iron' },
540
- // ],
541
- // })
542
- // await wrapper.vm.$nextTick()
543
-
544
- // expect(wrapper.html()).toMatchSnapshot()
545
- // })
546
-
547
- // // https://github.com/vuetifyjs/vuetify/issues/8359
548
- // it('should limit page to current page count if not using server-items-length', async () => {
549
- // const wrapper = mountFunction({
550
- // propsData: {
551
- // headers: testHeaders,
552
- // items: testItems,
553
- // page: 3,
554
- // itemsPerPage: 5,
555
- // },
556
- // })
557
-
558
- // expect(wrapper.html()).toMatchSnapshot()
559
- // })
560
-
561
- // // https://github.com/vuetifyjs/vuetify/issues/8184
562
- // it('should default to first option in itemsPerPageOptions if it does not include itemsPerPage', async () => {
563
- // const wrapper = mountFunction({
564
- // propsData: {
565
- // headers: testHeaders,
566
- // items: testItems,
567
- // footerProps: {
568
- // itemsPerPageOptions: [6, 7],
569
- // },
570
- // },
571
- // })
572
-
573
- // expect(wrapper.html()).toMatchSnapshot()
574
- // })
575
-
576
- // // https://github.com/vuetifyjs/vuetify/issues/8817
577
- // it('should handle object when checking if it should default to first option in itemsPerPageOptions', async () => {
578
- // const wrapper = mountFunction({
579
- // propsData: {
580
- // headers: testHeaders,
581
- // items: testItems,
582
- // itemsPerPage: -1,
583
- // footerProps: {
584
- // itemsPerPageOptions: [6, { text: 'All', value: -1 }],
585
- // },
586
- // },
587
- // })
588
-
589
- // expect(wrapper.html()).toMatchSnapshot()
590
- // })
591
-
592
- // // https://github.com/vuetifyjs/vuetify/issues/9599
593
- // it('should not immediately emit items-per-page', async () => {
594
- // const itemsPerPage = jest.fn()
595
- // const wrapper = mountFunction({
596
- // propsData: {
597
- // headers: testHeaders,
598
- // items: testItems,
599
- // footerProps: {
600
- // itemsPerPageOptions: [6, 7],
601
- // },
602
- // },
603
- // listeners: {
604
- // 'update:itemsPerPage': itemsPerPage,
605
- // },
606
- // })
607
-
608
- // expect(itemsPerPage).not.toHaveBeenCalled()
609
- // })
610
-
611
- // // https://github.com/vuetifyjs/vuetify/issues/9010
612
- // it('should change page if item count decreases below page start', async () => {
613
- // const page = jest.fn()
614
- // const wrapper = mountFunction({
615
- // propsData: {
616
- // headers: testHeaders,
617
- // items: testItems.slice(0, 4),
618
- // itemsPerPage: 2,
619
- // footerProps: {
620
- // itemsPerPageOptions: [2],
621
- // },
622
- // page: 2,
623
- // },
624
- // listeners: {
625
- // 'update:page': page,
626
- // },
627
- // })
628
-
629
- // expect(wrapper.html()).toMatchSnapshot()
630
-
631
- // wrapper.setProps({ items: testItems.slice(0, 2) })
632
- // await wrapper.vm.$nextTick()
633
-
634
- // expect(page).toHaveBeenCalledWith(1)
635
- // })
636
-
637
- // // https://github.com/vuetifyjs/vuetify/issues/8477
638
- // it('should emit two item-selected events when using single-select prop and selecting new item', async () => {
639
- // const itemSelected = jest.fn()
640
- // const wrapper = mountFunction({
641
- // propsData: {
642
- // headers: testHeaders,
643
- // itemKey: 'name',
644
- // items: testItems.slice(0, 2),
645
- // value: [testItems[0]],
646
- // showSelect: true,
647
- // singleSelect: true,
648
- // },
649
- // listeners: {
650
- // 'item-selected': itemSelected,
651
- // },
652
- // })
653
-
654
- // const checkbox = wrapper.findAll('.v-data-table__checkbox').at(1)
655
- // checkbox.trigger('click')
656
- // await wrapper.vm.$nextTick()
657
-
658
- // expect(itemSelected).toHaveBeenCalledTimes(2)
659
- // expect(itemSelected).toHaveBeenCalledWith({ item: testItems[0], value: false })
660
- // expect(itemSelected).toHaveBeenCalledWith({ item: testItems[1], value: true })
661
- // })
662
-
663
- // // https://github.com/vuetifyjs/vuetify/issues/8915
664
- // it('should not select item that is not selectable', async () => {
665
- // const items = [
666
- // { ...testItems[0], isSelectable: false },
667
- // { ...testItems[1] },
668
- // ]
669
- // const input = jest.fn()
670
- // const wrapper = mountFunction({
671
- // propsData: {
672
- // headers: testHeaders,
673
- // items,
674
- // showSelect: true,
675
- // },
676
- // listeners: {
677
- // input,
678
- // },
679
- // })
680
-
681
- // expect(wrapper.html()).toMatchSnapshot()
682
-
683
- // const selectAll = wrapper.findAll('.v-simple-checkbox').at(0)
684
- // selectAll.trigger('click')
685
- // await wrapper.vm.$nextTick()
686
-
687
- // expect(input).toHaveBeenNthCalledWith(1, [testItems[1]])
688
-
689
- // const single = wrapper.findAll('.v-simple-checkbox').at(1)
690
- // single.trigger('click')
691
- // await wrapper.vm.$nextTick()
692
-
693
- // expect(input.mock.calls).toHaveLength(1)
694
- // })
695
-
696
- // // https://github.com/vuetifyjs/vuetify/issues/8915
697
- // it('should toggle all selectable items', async () => {
698
- // const items = [
699
- // { ...testItems[0], isSelectable: false },
700
- // { ...testItems[1] },
701
- // ]
702
- // const input = jest.fn()
703
- // const wrapper = mountFunction({
704
- // propsData: {
705
- // headers: testHeaders,
706
- // items,
707
- // showSelect: true,
708
- // },
709
- // listeners: {
710
- // input,
711
- // },
712
- // })
713
-
714
- // const selectAll = wrapper.findAll('.v-simple-checkbox').at(0)
715
- // selectAll.trigger('click')
716
- // await wrapper.vm.$nextTick()
717
-
718
- // expect(input).toHaveBeenNthCalledWith(1, [testItems[1]])
719
-
720
- // selectAll.trigger('click')
721
- // await wrapper.vm.$nextTick()
722
-
723
- // expect(input).toHaveBeenNthCalledWith(2, [])
724
- // })
725
-
726
- // // https://github.com/vuetifyjs/vuetify/issues/10392
727
- // it('should search group-by column', async () => {
728
- // const headers = [
729
- // {
730
- // text: 'Name',
731
- // value: 'name',
732
- // },
733
- // {
734
- // text: 'ID',
735
- // value: 'id',
736
- // },
737
- // ]
738
-
739
- // const items = [
740
- // {
741
- // name: 'Assistance',
742
- // id: 1,
743
- // },
744
- // {
745
- // name: 'Candidat',
746
- // id: 2,
747
- // },
748
- // ]
749
-
750
- // const wrapper = mountFunction({
751
- // propsData: {
752
- // headers,
753
- // items,
754
- // itemKey: 'id',
755
- // groupBy: 'name',
756
- // },
757
- // })
758
-
759
- // expect(wrapper.html()).toMatchSnapshot()
760
-
761
- // wrapper.setProps({ search: 'candidat' })
762
- // await wrapper.vm.$nextTick()
763
-
764
- // expect(wrapper.html()).toMatchSnapshot()
765
- // })
766
-
767
- // // https://github.com/vuetifyjs/vuetify/issues/10289
768
- // it('should render item slot when using group-by function', async () => {
769
- // const wrapper = mountFunction({
770
- // propsData: {
771
- // headers: testHeaders,
772
- // itemKey: 'name',
773
- // items: testItems.slice(0, 2),
774
- // groupBy: 'name',
775
- // },
776
- // scopedSlots: {
777
- // item () {
778
- // return h('div', ['scoped'])
779
- // },
780
- // },
781
- // })
782
-
783
- // expect(wrapper.html()).toMatchSnapshot()
784
- // })
785
-
786
- // // https://github.com/vuetifyjs/vuetify/issues/10392
787
- // it('should emit pagination event when filtering', async () => {
788
- // const headers = [
789
- // {
790
- // text: 'Name',
791
- // value: 'name',
792
- // },
793
- // {
794
- // text: 'ID',
795
- // value: 'id',
796
- // },
797
- // ]
798
-
799
- // const items = [
800
- // {
801
- // name: 'Assistance',
802
- // id: 1,
803
- // },
804
- // {
805
- // name: 'Candidat',
806
- // id: 2,
807
- // },
808
- // ]
809
-
810
- // const pagination = jest.fn()
811
-
812
- // const wrapper = mountFunction({
813
- // propsData: {
814
- // headers,
815
- // items,
816
- // itemKey: 'id',
817
- // },
818
- // listeners: {
819
- // pagination,
820
- // },
821
- // })
822
-
823
- // expect(pagination).toHaveBeenLastCalledWith({
824
- // itemsLength: 2,
825
- // itemsPerPage: 10,
826
- // page: 1,
827
- // pageCount: 1,
828
- // pageStart: 0,
829
- // pageStop: 2,
830
- // })
831
-
832
- // wrapper.setProps({ search: 'candidat' })
833
- // await wrapper.vm.$nextTick()
834
-
835
- // expect(pagination).toHaveBeenLastCalledWith({
836
- // itemsLength: 1,
837
- // itemsPerPage: 10,
838
- // page: 1,
839
- // pageCount: 1,
840
- // pageStart: 0,
841
- // pageStop: 1,
842
- // })
843
-
844
- // expect(pagination).toHaveBeenCalledTimes(2)
845
- // })
846
-
847
- // // https://github.com/vuetifyjs/vuetify/issues/10715
848
- // // NOTE: This test currently succeeds regardless of fix
849
- // // It seems like the test environment does not double
850
- // // fire the events in the same way the browser does
851
- // it('should not emit too many pagination events', async () => {
852
- // const headers = [
853
- // {
854
- // text: 'Name',
855
- // value: 'name',
856
- // },
857
- // {
858
- // text: 'ID',
859
- // value: 'id',
860
- // },
861
- // ]
862
-
863
- // const items = [
864
- // {
865
- // name: 'Assistance',
866
- // id: 1,
867
- // },
868
- // {
869
- // name: 'Candidat',
870
- // id: 2,
871
- // },
872
- // ]
873
-
874
- // const wrapper = mountFunction({
875
- // propsData: {
876
- // headers,
877
- // itemKey: 'id',
878
- // serverItemsLength: 0,
879
- // },
880
- // })
881
-
882
- // wrapper.setProps({ items, serverItemsLength: items.length })
883
- // await wrapper.vm.$nextTick()
884
-
885
- // expect(wrapper.emitted().pagination).toHaveLength(2)
886
- // })
887
-
888
- // // https://github.com/vuetifyjs/vuetify/issues/4975
889
- // it('should show correct aria-labels when sorting', async () => {
890
- // const wrapper = mountFunction({
891
- // propsData: {
892
- // headers: testHeaders,
893
- // itemKey: 'name',
894
- // items: testItems.slice(0, 5),
895
- // sortBy: 'calories',
896
- // },
897
- // })
898
-
899
- // wrapper.setProps({ sortDesc: true })
900
- // await wrapper.vm.$nextTick()
901
-
902
- // expect(wrapper.html()).toMatchSnapshot()
903
-
904
- // wrapper.setProps({ mustSort: true })
905
- // await wrapper.vm.$nextTick()
906
-
907
- // expect(wrapper.html()).toMatchSnapshot()
908
- // })
909
-
910
- // it('should apply class list to rows', () => {
911
- // const wrapper = mountFunction({
912
- // propsData: {
913
- // headers: testHeaders,
914
- // items: testItems,
915
- // itemsPerPage: 5,
916
- // itemClass: () => ['my-class', 'my-other-class'],
917
- // },
918
- // })
919
-
920
- // expect(wrapper.html()).toMatchSnapshot()
921
- // })
922
-
923
- // it('should apply class unique to rows', () => {
924
- // const wrapper = mountFunction({
925
- // propsData: {
926
- // headers: testHeaders,
927
- // items: testItems,
928
- // itemsPerPage: 5,
929
- // itemClass: () => 'my-unique-class',
930
- // },
931
- // })
932
-
933
- // expect(wrapper.html()).toMatchSnapshot()
934
- // })
935
-
936
- // it('should apply class function to rows', () => {
937
- // const wrapper = mountFunction({
938
- // propsData: {
939
- // headers: testHeaders,
940
- // items: testItems,
941
- // itemsPerPage: 5,
942
- // itemClass: (item: Object) => ({
943
- // 'first-class': item.fat < 10,
944
- // 'second-class': item.protein > 4.0,
945
- // }),
946
- // },
947
- // })
948
-
949
- // expect(wrapper.html()).toMatchSnapshot()
950
- // })
951
-
952
- // it('should apply class from item to rows', () => {
953
- // const wrapper = mountFunction({
954
- // propsData: {
955
- // headers: testHeaders,
956
- // items: testItems,
957
- // itemsPerPage: 5,
958
- // itemClass: 'class',
959
- // },
960
- // })
961
-
962
- // expect(wrapper.html()).toMatchSnapshot()
963
- // })
964
-
965
- // // https://github.com/vuetifyjs/vuetify/issues/11600
966
- // it('should return rows from columns that match custom filters', async () => {
967
- // const wrapper = mountFunction({
968
- // propsData: {
969
- // items: testItems,
970
- // filterMode: 'union',
971
- // headers: [
972
- // { text: 'Dessert (100g serving)', align: 'left', value: 'name' },
973
- // { text: 'Calories', value: 'calories', filter: value => value === 159 },
974
- // { text: 'Fat (g)', value: 'fat' },
975
- // { text: 'Carbs (g)', value: 'carbs' },
976
- // { text: 'Protein (g)', value: 'protein' },
977
- // { text: 'Iron (%)', value: 'iron' },
978
- // ],
979
- // },
980
- // })
981
-
982
- // wrapper.setProps({ search: 'eclair' })
983
- // await wrapper.vm.$nextTick()
984
- // expect(wrapper.vm.internalCurrentItems).toHaveLength(2)
985
- // })
986
-
987
- // // https://github.com/vuetifyjs/vuetify/issues/11179
988
- // it('should return rows from columns that exclusively match custom filters', async () => {
989
- // const wrapper = mountFunction({
990
- // propsData: {
991
- // items: testItems,
992
- // filterMode: 'intersection',
993
- // headers: [
994
- // { text: 'Dessert (100g serving)', align: 'left', value: 'name' },
995
- // { text: 'Calories', value: 'calories', filter: value => value === 159 },
996
- // { text: 'Fat (g)', value: 'fat' },
997
- // { text: 'Carbs (g)', value: 'carbs' },
998
- // { text: 'Protein (g)', value: 'protein' },
999
- // { text: 'Iron (%)', value: 'iron' },
1000
- // ],
1001
- // },
1002
- // })
1003
-
1004
- // wrapper.setProps({ search: 'eclair' })
1005
- // await wrapper.vm.$nextTick()
1006
- // expect(wrapper.vm.internalCurrentItems).toHaveLength(0)
1007
-
1008
- // wrapper.setProps({ search: 'frozen' })
1009
- // await wrapper.vm.$nextTick()
1010
- // expect(wrapper.vm.internalCurrentItems).toHaveLength(1)
1011
- // })
1012
-
1013
- // // https://github.com/vuetifyjs/vuetify/issues/10244
1014
- // it('should respect mustSort property on options', async () => {
1015
- // const wrapper = mountFunction({
1016
- // propsData: {
1017
- // items: testItems,
1018
- // headers: [
1019
- // { text: 'Dessert (100g serving)', value: 'name' },
1020
- // ],
1021
- // options: {
1022
- // mustSort: true,
1023
- // },
1024
- // },
1025
- // })
1026
-
1027
- // wrapper.find('th').trigger('click')
1028
- // await wrapper.vm.$nextTick()
1029
-
1030
- // wrapper.find('th').trigger('click')
1031
- // await wrapper.vm.$nextTick()
1032
-
1033
- // wrapper.find('th').trigger('click')
1034
- // await wrapper.vm.$nextTick()
1035
-
1036
- // expect(wrapper.html()).toMatchSnapshot()
1037
- // })
1038
-
1039
- // it('should hide group button when column is not groupable', async () => {
1040
- // const wrapper = mountFunction({
1041
- // propsData: {
1042
- // showGroupBy: true,
1043
- // items: testItems,
1044
- // headers: [
1045
- // {
1046
- // text: 'Dessert (100g serving)',
1047
- // align: 'left',
1048
- // value: 'name',
1049
- // groupable: false,
1050
- // },
1051
- // { text: 'Calories', value: 'calories' },
1052
- // { text: 'Fat (g)', value: 'fat' },
1053
- // { text: 'Carbs (g)', value: 'carbs' },
1054
- // { text: 'Protein (g)', value: 'protein' },
1055
- // { text: 'Iron (%)', value: 'iron' },
1056
- // ],
1057
- // },
1058
- // })
1059
-
1060
- // expect(wrapper.html()).toMatchSnapshot()
1061
- // })
1062
-
1063
- // it('should return rows matching search term if specified', async () => {
1064
- // const wrapper = mountFunction({
1065
- // propsData: {
1066
- // items: testItems,
1067
- // headers: [
1068
- // { text: 'Dessert (100g serving)', align: 'left', value: 'name' },
1069
- // { text: 'Calories', value: 'calories' },
1070
- // { text: 'Fat (g)', value: 'fat' },
1071
- // { text: 'Carbs (g)', value: 'carbs' },
1072
- // { text: 'Protein (g)', value: 'protein' },
1073
- // { text: 'Iron (%)', value: 'iron' },
1074
- // ],
1075
- // },
1076
- // })
1077
-
1078
- // wrapper.setProps({ search: 'unknown-term' })
1079
- // await wrapper.vm.$nextTick()
1080
- // expect(wrapper.vm.internalCurrentItems).toHaveLength(0)
1081
-
1082
- // wrapper.setProps({ search: 'Eclair' })
1083
- // await wrapper.vm.$nextTick()
1084
- // expect(wrapper.vm.internalCurrentItems).toHaveLength(1)
1085
- // })
1086
-
1087
- // it('should return results which match both search term and column filters if both specified', async () => {
1088
- // const wrapper = mountFunction({
1089
- // propsData: {
1090
- // items: testItems,
1091
- // headers: [
1092
- // { text: 'Dessert (100g serving)', align: 'left', value: 'name' },
1093
- // { text: 'Calories', value: 'calories', filter: value => value < 300 },
1094
- // { text: 'Fat (g)', value: 'fat' },
1095
- // { text: 'Carbs (g)', value: 'carbs' },
1096
- // { text: 'Protein (g)', value: 'protein' },
1097
- // { text: 'Iron (%)', value: 'iron' },
1098
- // ],
1099
- // },
1100
- // })
1101
-
1102
- // wrapper.setProps({ search: 'EA' })
1103
- // await wrapper.vm.$nextTick()
1104
- // expect(wrapper.vm.internalCurrentItems).toHaveLength(1)
1105
- // })
1106
-
1107
- // // https://github.com/vuetifyjs/vuetify/issues/14006
1108
- // it('should allow selection on second page when using numbers as item key', async () => {
1109
- // const input = jest.fn()
1110
- // const items = testItems.map((item, index) => ({ ...item, name: index + 1 })).slice(0, 8)
1111
- // const wrapper = mountFunction({
1112
- // propsData: {
1113
- // items,
1114
- // itemKey: 'name',
1115
- // itemsPerPage: 5,
1116
- // showSelect: true,
1117
- // headers: testHeaders,
1118
- // mobileBreakpoint: 0,
1119
- // },
1120
- // listeners: {
1121
- // input,
1122
- // },
1123
- // })
1124
-
1125
- // let checkbox = wrapper.findAll('td > .v-data-table__checkbox').at(4)
1126
-
1127
- // checkbox.trigger('click')
1128
- // await wrapper.vm.$nextTick()
1129
-
1130
- // wrapper.setProps({ page: 2 })
1131
- // await wrapper.vm.$nextTick()
1132
-
1133
- // checkbox = wrapper.findAll('td > .v-data-table__checkbox').at(0)
1134
-
1135
- // checkbox.trigger('click')
1136
- // await wrapper.vm.$nextTick()
1137
-
1138
- // expect(input).toHaveBeenCalledWith([items[4], items[5]])
1139
- // })
166
+ it('should render with data', () => {
167
+ const wrapper = mountFunction({
168
+ props: {
169
+ headers: testHeaders,
170
+ items: testItems,
171
+ itemsPerPage: 5,
172
+ },
173
+ })
174
+
175
+ expect(wrapper.html()).toMatchSnapshot()
176
+ })
177
+
178
+ it('should render with body slot', () => {
179
+ const wrapper = mountFunction({
180
+ props: {
181
+ headers: testHeaders,
182
+ items: testItems,
183
+ itemsPerPage: 5,
184
+ },
185
+ slots: {
186
+ body: (props: any) => h('div', [props.items.length]),
187
+ },
188
+ })
189
+
190
+ expect(wrapper.html()).toMatchSnapshot()
191
+ })
192
+
193
+ it('should render with foot slot', () => {
194
+ const wrapper = mountFunction({
195
+ props: {
196
+ headers: testHeaders,
197
+ items: testItems,
198
+ itemsPerPage: 5,
199
+ },
200
+ slots: {
201
+ foot: (props: any) => h('tfoot', [props.items.length]),
202
+ },
203
+ })
204
+
205
+ expect(wrapper.html()).toMatchSnapshot()
206
+ })
207
+
208
+ it('should render virtual table', () => {
209
+ const wrapper = mountFunction({
210
+ props: {
211
+ headers: testHeaders,
212
+ items: testItems,
213
+ itemsPerPage: 5,
214
+ virtualRows: true,
215
+ },
216
+ })
217
+
218
+ expect(wrapper.html()).toMatchSnapshot()
219
+ })
220
+
221
+ it('should render with showExpand', async () => {
222
+ const expand = jest.fn()
223
+ const wrapper = mountFunction({
224
+ props: {
225
+ headers: testHeaders,
226
+ itemKey: 'name',
227
+ items: testItems,
228
+ itemsPerPage: 5,
229
+ showExpand: true,
230
+ },
231
+ attrs: {
232
+ 'onUpdate:expanded': expand,
233
+ },
234
+ })
235
+
236
+ expect(wrapper.html()).toMatchSnapshot()
237
+
238
+ const expandIcon = wrapper.findAll('.v-data-table__expand-icon')[0]
239
+ if (expandIcon) {
240
+ expandIcon.trigger('click')
241
+ }
242
+
243
+ await nextTick()
244
+ expect(expand).toHaveBeenCalledWith(testItems.slice(0, 1))
245
+ expect(wrapper.html()).toMatchSnapshot()
246
+ })
247
+
248
+ it('should render with showSelect', () => {
249
+ const wrapper = mountFunction({
250
+ props: {
251
+ headers: testHeaders,
252
+ items: testItems,
253
+ itemsPerPage: 5,
254
+ showSelect: true,
255
+ },
256
+ })
257
+
258
+ expect(wrapper.html()).toMatchSnapshot()
259
+ })
260
+
261
+ it('should render with item.expanded scoped slot', async () => {
262
+ const wrapper = mountFunction({
263
+ props: {
264
+ headers: testHeaders,
265
+ items: testItems,
266
+ itemsPerPage: 5,
267
+ expanded: testItems,
268
+ },
269
+ slots: {
270
+ 'expanded-item': (props: any) => h('div', ['expanded']),
271
+ },
272
+ })
273
+
274
+ await nextTick()
275
+
276
+ expect(wrapper.html()).toMatchSnapshot()
277
+ })
278
+
279
+ it('should render with group.summary scoped slot', () => {
280
+ const wrapper = mountFunction({
281
+ props: {
282
+ headers: testHeaders,
283
+ items: testItems,
284
+ itemsPerPage: 5,
285
+ groupBy: 'calories',
286
+ },
287
+ slots: {
288
+ 'group.summary': (props: any) => h('div', ['summary']),
289
+ },
290
+ })
291
+
292
+ expect(wrapper.html()).toMatchSnapshot()
293
+ })
294
+
295
+ it('should render with item scoped slot', () => {
296
+ const wrapper = mountFunction({
297
+ props: {
298
+ headers: testHeaders,
299
+ items: testItems,
300
+ itemsPerPage: 5,
301
+ },
302
+ slots: {
303
+ item: (props: any) => h('div', [JSON.stringify(props)]),
304
+ },
305
+ })
306
+
307
+ expect(wrapper.html()).toMatchSnapshot()
308
+ })
309
+
310
+ it('should render with grouped rows', () => {
311
+ const wrapper = mountFunction({
312
+ props: {
313
+ headers: testHeaders,
314
+ items: testItems,
315
+ itemsPerPage: 5,
316
+ groupBy: ['protein'],
317
+ },
318
+ })
319
+
320
+ expect(wrapper.html()).toMatchSnapshot()
321
+ })
322
+
323
+ it('should render with group scoped slot', () => {
324
+ const wrapper = mountFunction({
325
+ props: {
326
+ headers: testHeaders,
327
+ items: testItems,
328
+ itemsPerPage: 5,
329
+ groupBy: ['protein'],
330
+ },
331
+ slots: {
332
+ group: (props: any) => h('div', [JSON.stringify(props)]),
333
+ },
334
+ })
335
+
336
+ expect(wrapper.html()).toMatchSnapshot()
337
+ })
338
+
339
+ it('should render loading state', () => {
340
+ const wrapper = mountFunction({
341
+ props: {
342
+ loading: true,
343
+ checkboxColor: 'primary',
344
+ color: 'primary',
345
+ },
346
+ })
347
+
348
+ expect(wrapper.html()).toMatchSnapshot()
349
+
350
+ const wrapper2 = mountFunction({
351
+ props: {
352
+ headers: testHeaders,
353
+ loading: true,
354
+ },
355
+ slots: {
356
+ progress: () => h('div', { class: 'progress' }, '50%'),
357
+ },
358
+ })
359
+
360
+ expect(wrapper2.html()).toMatchSnapshot()
361
+ })
362
+
363
+ it.each([
364
+ 'click',
365
+ 'contextmenu',
366
+ 'dblclick',
367
+ ])('should render row that can handle %s events', async event => {
368
+ const wrapper = mountFunction({
369
+ props: {
370
+ headers: testHeaders,
371
+ items: testItems,
372
+ },
373
+ })
374
+
375
+ const row = wrapper.find('tbody tr')
376
+ expect(row.exists()).toBe(true)
377
+
378
+ // Just test that the event can be triggered without errors
379
+ if (row.exists()) {
380
+ await row.trigger(event)
381
+ await nextTick()
382
+ }
383
+ })
384
+
385
+ // https://github.com/vuetifyjs/vuetify/issues/8254
386
+ it('should pass kebab-case footer props correctly', () => {
387
+ const wrapper = mountFunction({
388
+ props: {
389
+ headers: [],
390
+ items: [],
391
+ footerProps: {
392
+ 'items-per-page-text': 'Foo:',
393
+ },
394
+ },
395
+ })
396
+
397
+ expect(wrapper.html()).toMatchSnapshot()
398
+ })
399
+
400
+ // https://github.com/vuetifyjs/vuetify/issues/8266
401
+ it('should use options prop for initial values', () => {
402
+ const fn = jest.fn()
403
+ const wrapper = mountFunction({
404
+ props: {
405
+ headers: testHeaders,
406
+ items: testItems,
407
+ options: {
408
+ page: 2,
409
+ itemsPerPage: 5,
410
+ },
411
+ },
412
+ attrs: {
413
+ 'onUpdate:options': fn,
414
+ },
415
+ })
416
+
417
+ expect(fn).toHaveBeenCalledWith(expect.objectContaining({
418
+ page: 2,
419
+ }))
420
+ })
421
+
422
+ it('should render footer.prepend slot content', () => {
423
+ const wrapper = mountFunction({
424
+ props: {
425
+ headers: [],
426
+ items: [{}],
427
+ },
428
+ slots: {
429
+ 'footer.prepend': () => h('div', ['footer.prepend slot content']),
430
+ },
431
+ })
432
+
433
+ expect(wrapper.html()).toMatchSnapshot()
434
+ })
435
+
436
+ it('should render footer.page-text slot content', () => {
437
+ const wrapper = mountFunction({
438
+ props: {
439
+ headers: [],
440
+ items: [{}],
441
+ },
442
+ slots: {
443
+ 'footer.page-text': ({ pageStart, pageStop }: any) => h('div', [`foo ${pageStart} bar ${pageStop}`]),
444
+ },
445
+ })
446
+
447
+ expect(wrapper.html()).toMatchSnapshot()
448
+ })
449
+
450
+ // https://github.com/vuetifyjs/vuetify/issues/8359
451
+ it('should not limit page to current item count when using server-items-length', async () => {
452
+ const wrapper = mountFunction({
453
+ props: {
454
+ headers: testHeaders,
455
+ items: [],
456
+ page: 2,
457
+ itemsPerPage: 5,
458
+ serverItemsLength: 0,
459
+ },
460
+ })
461
+
462
+ expect(wrapper.html()).toMatchSnapshot()
463
+
464
+ wrapper.setProps({
465
+ items: testItems.slice(5),
466
+ serverItemsLength: 20,
467
+ })
468
+ await nextTick()
469
+
470
+ expect(wrapper.html()).toMatchSnapshot()
471
+ })
472
+
473
+ it('should not search column with filterable set to false', async () => {
474
+ const wrapper = mountFunction({
475
+ props: {
476
+ items: testItems,
477
+ headers: [
478
+ {
479
+ text: 'Dessert (100g serving)',
480
+ align: 'left',
481
+ filterable: false,
482
+ value: 'name',
483
+ },
484
+ { text: 'Calories', value: 'calories' },
485
+ { text: 'Fat (g)', value: 'fat' },
486
+ { text: 'Carbs (g)', value: 'carbs' },
487
+ { text: 'Protein (g)', value: 'protein' },
488
+ { text: 'Iron (%)', value: 'iron' },
489
+ ],
490
+ },
491
+ })
492
+
493
+ expect(wrapper.html()).toMatchSnapshot()
494
+
495
+ wrapper.setProps({
496
+ search: 'cup',
497
+ })
498
+ await nextTick()
499
+
500
+ expect(wrapper.html()).toMatchSnapshot()
501
+ })
502
+
503
+ it('should not search column with filterable set to false and has filter function', async () => {
504
+ const wrapper = mountFunction({
505
+ props: {
506
+ items: testItems,
507
+ headers: [
508
+ {
509
+ text: 'Dessert (100g serving)',
510
+ align: 'left',
511
+ value: 'name',
512
+ },
513
+ { text: 'Calories', value: 'calories', filter: (v: any) => v > 400 },
514
+ { text: 'Fat (g)', value: 'fat' },
515
+ { text: 'Carbs (g)', value: 'carbs' },
516
+ { text: 'Protein (g)', value: 'protein' },
517
+ { text: 'Iron (%)', value: 'iron' },
518
+ ],
519
+ },
520
+ })
521
+
522
+ expect(wrapper.html()).toMatchSnapshot()
523
+
524
+ wrapper.setProps({
525
+ headers: [
526
+ {
527
+ text: 'Dessert (100g serving)',
528
+ align: 'left',
529
+ value: 'name',
530
+ },
531
+ { text: 'Calories', value: 'calories', filter: (v: any) => v > 400, filterable: false },
532
+ { text: 'Fat (g)', value: 'fat' },
533
+ { text: 'Carbs (g)', value: 'carbs' },
534
+ { text: 'Protein (g)', value: 'protein' },
535
+ { text: 'Iron (%)', value: 'iron' },
536
+ ],
537
+ })
538
+ await nextTick()
539
+
540
+ expect(wrapper.html()).toMatchSnapshot()
541
+ })
542
+
543
+ // https://github.com/vuetifyjs/vuetify/issues/8359
544
+ it('should limit page to current page count if not using server-items-length', async () => {
545
+ const wrapper = mountFunction({
546
+ props: {
547
+ headers: testHeaders,
548
+ items: testItems,
549
+ page: 3,
550
+ itemsPerPage: 5,
551
+ },
552
+ })
553
+
554
+ expect(wrapper.html()).toMatchSnapshot()
555
+ })
556
+
557
+ // https://github.com/vuetifyjs/vuetify/issues/8184
558
+ it('should default to first option in itemsPerPageOptions if it does not include itemsPerPage', async () => {
559
+ const wrapper = mountFunction({
560
+ props: {
561
+ headers: testHeaders,
562
+ items: testItems,
563
+ footerProps: {
564
+ itemsPerPageOptions: [6, 7],
565
+ },
566
+ },
567
+ })
568
+
569
+ expect(wrapper.html()).toMatchSnapshot()
570
+ })
571
+
572
+ // https://github.com/vuetifyjs/vuetify/issues/8817
573
+ it('should handle object when checking if it should default to first option in itemsPerPageOptions', async () => {
574
+ const wrapper = mountFunction({
575
+ props: {
576
+ headers: testHeaders,
577
+ items: testItems,
578
+ itemsPerPage: -1,
579
+ footerProps: {
580
+ itemsPerPageOptions: [6, { text: 'All', value: -1 }],
581
+ },
582
+ },
583
+ })
584
+
585
+ expect(wrapper.html()).toMatchSnapshot()
586
+ })
587
+
588
+ // https://github.com/vuetifyjs/vuetify/issues/9599
589
+ it('should not immediately emit items-per-page', async () => {
590
+ const itemsPerPage = jest.fn()
591
+ const wrapper = mountFunction({
592
+ props: {
593
+ headers: testHeaders,
594
+ items: testItems,
595
+ footerProps: {
596
+ itemsPerPageOptions: [6, 7],
597
+ },
598
+ },
599
+ attrs: {
600
+ 'onUpdate:itemsPerPage': itemsPerPage,
601
+ },
602
+ })
603
+
604
+ expect(itemsPerPage).not.toHaveBeenCalled()
605
+ })
606
+
607
+ // https://github.com/vuetifyjs/vuetify/issues/9010
608
+ it('should change page if item count decreases below page start', async () => {
609
+ const page = jest.fn()
610
+ const wrapper = mountFunction({
611
+ props: {
612
+ headers: testHeaders,
613
+ items: testItems.slice(0, 4),
614
+ itemsPerPage: 2,
615
+ footerProps: {
616
+ itemsPerPageOptions: [2],
617
+ },
618
+ page: 2,
619
+ },
620
+ attrs: {
621
+ 'onUpdate:page': page,
622
+ },
623
+ })
624
+
625
+ expect(wrapper.html()).toMatchSnapshot()
626
+
627
+ wrapper.setProps({ items: testItems.slice(0, 2) })
628
+ await nextTick()
629
+
630
+ expect(page).toHaveBeenCalledWith(1)
631
+ })
632
+
633
+ it('should render with single-select checkboxes', async () => {
634
+ const wrapper = mountFunction({
635
+ props: {
636
+ headers: testHeaders,
637
+ itemKey: 'name',
638
+ items: testItems.slice(0, 2),
639
+ value: [testItems[0]],
640
+ showSelect: true,
641
+ singleSelect: true,
642
+ },
643
+ })
644
+
645
+ const checkboxes = wrapper.findAll('.v-data-table__checkbox')
646
+ expect(checkboxes.length).toBeGreaterThan(0)
647
+ expect(wrapper.html()).toMatchSnapshot()
648
+ })
649
+
650
+ it('should render non-selectable items correctly', async () => {
651
+ const items = [
652
+ { ...testItems[0], isSelectable: false },
653
+ { ...testItems[1] },
654
+ ]
655
+ const wrapper = mountFunction({
656
+ props: {
657
+ headers: testHeaders,
658
+ items,
659
+ showSelect: true,
660
+ },
661
+ })
662
+
663
+ expect(wrapper.html()).toMatchSnapshot()
664
+ const checkboxes = wrapper.findAll('.v-simple-checkbox')
665
+ expect(checkboxes.length).toBeGreaterThan(0)
666
+ })
667
+
668
+ it('should render select-all checkbox when items are selectable', async () => {
669
+ const items = [
670
+ { ...testItems[0], isSelectable: false },
671
+ { ...testItems[1] },
672
+ ]
673
+ const wrapper = mountFunction({
674
+ props: {
675
+ headers: testHeaders,
676
+ items,
677
+ showSelect: true,
678
+ },
679
+ })
680
+
681
+ const selectAll = wrapper.findAll('.v-simple-checkbox')[0]
682
+ expect(selectAll.exists()).toBe(true)
683
+ expect(wrapper.html()).toMatchSnapshot()
684
+ })
685
+
686
+ // https://github.com/vuetifyjs/vuetify/issues/10392
687
+ it('should search group-by column', async () => {
688
+ const headers = [
689
+ {
690
+ text: 'Name',
691
+ value: 'name',
692
+ },
693
+ {
694
+ text: 'ID',
695
+ value: 'id',
696
+ },
697
+ ]
698
+
699
+ const items = [
700
+ {
701
+ name: 'Assistance',
702
+ id: 1,
703
+ },
704
+ {
705
+ name: 'Candidat',
706
+ id: 2,
707
+ },
708
+ ]
709
+
710
+ const wrapper = mountFunction({
711
+ props: {
712
+ headers,
713
+ items,
714
+ itemKey: 'id',
715
+ groupBy: 'name',
716
+ },
717
+ })
718
+
719
+ expect(wrapper.html()).toMatchSnapshot()
720
+
721
+ wrapper.setProps({ search: 'candidat' })
722
+ await nextTick()
723
+
724
+ expect(wrapper.html()).toMatchSnapshot()
725
+ })
726
+
727
+ it('should render item slot when using group-by function', async () => {
728
+ const wrapper = mountFunction({
729
+ props: {
730
+ headers: testHeaders,
731
+ itemKey: 'name',
732
+ items: testItems.slice(0, 2),
733
+ groupBy: 'name',
734
+ },
735
+ slots: {
736
+ item: () => h('div', ['scoped']),
737
+ },
738
+ })
739
+
740
+ expect(wrapper.html()).toMatchSnapshot()
741
+ })
742
+
743
+ it('should handle filtering correctly', async () => {
744
+ const headers = [
745
+ {
746
+ text: 'Name',
747
+ value: 'name',
748
+ },
749
+ {
750
+ text: 'ID',
751
+ value: 'id',
752
+ },
753
+ ]
754
+
755
+ const items = [
756
+ {
757
+ name: 'Assistance',
758
+ id: 1,
759
+ },
760
+ {
761
+ name: 'Candidat',
762
+ id: 2,
763
+ },
764
+ ]
765
+
766
+ const wrapper = mountFunction({
767
+ props: {
768
+ headers,
769
+ items,
770
+ itemKey: 'id',
771
+ },
772
+ })
773
+
774
+ expect(wrapper.html()).toMatchSnapshot()
775
+
776
+ wrapper.setProps({ search: 'candidat' })
777
+ await nextTick()
778
+
779
+ expect(wrapper.html()).toMatchSnapshot()
780
+ })
781
+
782
+ it('should not emit too many pagination events', async () => {
783
+ const headers = [
784
+ {
785
+ text: 'Name',
786
+ value: 'name',
787
+ },
788
+ {
789
+ text: 'ID',
790
+ value: 'id',
791
+ },
792
+ ]
793
+
794
+ const items = [
795
+ {
796
+ name: 'Assistance',
797
+ id: 1,
798
+ },
799
+ {
800
+ name: 'Candidat',
801
+ id: 2,
802
+ },
803
+ ]
804
+
805
+ const wrapper = mountFunction({
806
+ props: {
807
+ headers,
808
+ itemKey: 'id',
809
+ serverItemsLength: 0,
810
+ },
811
+ })
812
+
813
+ wrapper.setProps({ items, serverItemsLength: items.length })
814
+ await nextTick()
815
+
816
+ expect(wrapper.emitted().pagination).toHaveLength(2)
817
+ })
818
+
819
+ it('should show correct aria-labels when sorting', async () => {
820
+ const wrapper = mountFunction({
821
+ props: {
822
+ headers: testHeaders,
823
+ itemKey: 'name',
824
+ items: testItems.slice(0, 5),
825
+ sortBy: 'calories',
826
+ },
827
+ })
828
+
829
+ wrapper.setProps({ sortDesc: true })
830
+ await nextTick()
831
+
832
+ expect(wrapper.html()).toMatchSnapshot()
833
+
834
+ wrapper.setProps({ mustSort: true })
835
+ await nextTick()
836
+
837
+ expect(wrapper.html()).toMatchSnapshot()
838
+ })
839
+
840
+ it('should apply class list to rows', () => {
841
+ const wrapper = mountFunction({
842
+ props: {
843
+ headers: testHeaders,
844
+ items: testItems,
845
+ itemsPerPage: 5,
846
+ itemClass: () => ['my-class', 'my-other-class'],
847
+ },
848
+ })
849
+
850
+ expect(wrapper.html()).toMatchSnapshot()
851
+ })
852
+
853
+ it('should apply class unique to rows', () => {
854
+ const wrapper = mountFunction({
855
+ props: {
856
+ headers: testHeaders,
857
+ items: testItems,
858
+ itemsPerPage: 5,
859
+ itemClass: () => 'my-unique-class',
860
+ },
861
+ })
862
+
863
+ expect(wrapper.html()).toMatchSnapshot()
864
+ })
865
+
866
+ it('should apply class function to rows', () => {
867
+ const wrapper = mountFunction({
868
+ props: {
869
+ headers: testHeaders,
870
+ items: testItems,
871
+ itemsPerPage: 5,
872
+ itemClass: (item: any) => ({
873
+ 'first-class': item.fat < 10,
874
+ 'second-class': item.protein > 4.0,
875
+ }),
876
+ },
877
+ })
878
+
879
+ expect(wrapper.html()).toMatchSnapshot()
880
+ })
881
+
882
+ it('should apply class from item to rows', () => {
883
+ const wrapper = mountFunction({
884
+ props: {
885
+ headers: testHeaders,
886
+ items: testItems,
887
+ itemsPerPage: 5,
888
+ itemClass: 'class',
889
+ },
890
+ })
891
+
892
+ expect(wrapper.html()).toMatchSnapshot()
893
+ })
894
+
895
+ // https://github.com/vuetifyjs/vuetify/issues/11600
896
+ it('should return rows from columns that match custom filters', async () => {
897
+ const wrapper = mountFunction({
898
+ props: {
899
+ items: testItems,
900
+ filterMode: 'union',
901
+ headers: [
902
+ { text: 'Dessert (100g serving)', align: 'left', value: 'name' },
903
+ { text: 'Calories', value: 'calories', filter: (value: any) => value === 159 },
904
+ { text: 'Fat (g)', value: 'fat' },
905
+ { text: 'Carbs (g)', value: 'carbs' },
906
+ { text: 'Protein (g)', value: 'protein' },
907
+ { text: 'Iron (%)', value: 'iron' },
908
+ ],
909
+ },
910
+ })
911
+
912
+ wrapper.setProps({ search: 'eclair' })
913
+ await nextTick()
914
+ expect(wrapper.vm.internalCurrentItems).toHaveLength(2)
915
+ })
916
+
917
+ it('should return rows from columns that exclusively match custom filters', async () => {
918
+ const wrapper = mountFunction({
919
+ props: {
920
+ items: testItems,
921
+ filterMode: 'intersection',
922
+ headers: [
923
+ { text: 'Dessert (100g serving)', align: 'left', value: 'name' },
924
+ { text: 'Calories', value: 'calories', filter: (value: any) => value === 159 },
925
+ { text: 'Fat (g)', value: 'fat' },
926
+ { text: 'Carbs (g)', value: 'carbs' },
927
+ { text: 'Protein (g)', value: 'protein' },
928
+ { text: 'Iron (%)', value: 'iron' },
929
+ ],
930
+ },
931
+ })
932
+
933
+ wrapper.setProps({ search: 'eclair' })
934
+ await nextTick()
935
+ expect(wrapper.vm.internalCurrentItems).toHaveLength(0)
936
+
937
+ wrapper.setProps({ search: 'frozen' })
938
+ await nextTick()
939
+ expect(wrapper.vm.internalCurrentItems).toHaveLength(1)
940
+ })
941
+
942
+ it('should respect mustSort property on options', async () => {
943
+ const wrapper = mountFunction({
944
+ props: {
945
+ items: testItems,
946
+ headers: [
947
+ { text: 'Dessert (100g serving)', value: 'name' },
948
+ ],
949
+ options: {
950
+ mustSort: true,
951
+ },
952
+ },
953
+ })
954
+
955
+ wrapper.find('th').trigger('click')
956
+ await nextTick()
957
+
958
+ wrapper.find('th').trigger('click')
959
+ await nextTick()
960
+
961
+ wrapper.find('th').trigger('click')
962
+ await nextTick()
963
+
964
+ expect(wrapper.html()).toMatchSnapshot()
965
+ })
966
+
967
+ it('should hide group button when column is not groupable', async () => {
968
+ const wrapper = mountFunction({
969
+ props: {
970
+ showGroupBy: true,
971
+ items: testItems,
972
+ headers: [
973
+ {
974
+ text: 'Dessert (100g serving)',
975
+ align: 'left',
976
+ value: 'name',
977
+ groupable: false,
978
+ },
979
+ { text: 'Calories', value: 'calories' },
980
+ { text: 'Fat (g)', value: 'fat' },
981
+ { text: 'Carbs (g)', value: 'carbs' },
982
+ { text: 'Protein (g)', value: 'protein' },
983
+ { text: 'Iron (%)', value: 'iron' },
984
+ ],
985
+ },
986
+ })
987
+
988
+ expect(wrapper.html()).toMatchSnapshot()
989
+ })
990
+
991
+ it('should return rows matching search term if specified', async () => {
992
+ const wrapper = mountFunction({
993
+ props: {
994
+ items: testItems,
995
+ headers: [
996
+ { text: 'Dessert (100g serving)', align: 'left', value: 'name' },
997
+ { text: 'Calories', value: 'calories' },
998
+ { text: 'Fat (g)', value: 'fat' },
999
+ { text: 'Carbs (g)', value: 'carbs' },
1000
+ { text: 'Protein (g)', value: 'protein' },
1001
+ { text: 'Iron (%)', value: 'iron' },
1002
+ ],
1003
+ },
1004
+ })
1005
+
1006
+ wrapper.setProps({ search: 'unknown-term' })
1007
+ await nextTick()
1008
+ expect(wrapper.vm.internalCurrentItems).toHaveLength(0)
1009
+
1010
+ wrapper.setProps({ search: 'Eclair' })
1011
+ await nextTick()
1012
+ expect(wrapper.vm.internalCurrentItems).toHaveLength(1)
1013
+ })
1014
+
1015
+ it('should return results which match both search term and column filters if both specified', async () => {
1016
+ const wrapper = mountFunction({
1017
+ props: {
1018
+ items: testItems,
1019
+ headers: [
1020
+ { text: 'Dessert (100g serving)', align: 'left', value: 'name' },
1021
+ { text: 'Calories', value: 'calories', filter: (value: any) => value < 300 },
1022
+ { text: 'Fat (g)', value: 'fat' },
1023
+ { text: 'Carbs (g)', value: 'carbs' },
1024
+ { text: 'Protein (g)', value: 'protein' },
1025
+ { text: 'Iron (%)', value: 'iron' },
1026
+ ],
1027
+ },
1028
+ })
1029
+
1030
+ wrapper.setProps({ search: 'EA' })
1031
+ await nextTick()
1032
+ expect(wrapper.vm.internalCurrentItems).toHaveLength(1)
1033
+ })
1034
+
1035
+ it('should render selection checkboxes on multiple pages with numeric item keys', async () => {
1036
+ const items = testItems.map((item, index) => ({ ...item, name: index + 1 })).slice(0, 8)
1037
+ const wrapper = mountFunction({
1038
+ props: {
1039
+ items,
1040
+ itemKey: 'name',
1041
+ itemsPerPage: 5,
1042
+ showSelect: true,
1043
+ headers: testHeaders,
1044
+ mobileBreakpoint: 0,
1045
+ },
1046
+ })
1047
+
1048
+ // Just check that the component renders without errors
1049
+ expect(wrapper.html()).toContain('v-data-table')
1050
+
1051
+ wrapper.setProps({ page: 2 })
1052
+ await nextTick()
1053
+
1054
+ // Check that page 2 renders without errors
1055
+ expect(wrapper.html()).toContain('v-data-table')
1056
+ expect(wrapper.html()).toMatchSnapshot()
1057
+ })
1140
1058
  })