@patternfly/react-core 4.202.30 → 4.202.33

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 (293) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/esm/components/Wizard/Wizard.d.ts +2 -0
  3. package/dist/esm/components/Wizard/Wizard.d.ts.map +1 -1
  4. package/dist/esm/components/Wizard/Wizard.js +3 -2
  5. package/dist/esm/components/Wizard/Wizard.js.map +1 -1
  6. package/dist/esm/components/Wizard/WizardHeader.d.ts +2 -0
  7. package/dist/esm/components/Wizard/WizardHeader.d.ts.map +1 -1
  8. package/dist/esm/components/Wizard/WizardHeader.js +2 -2
  9. package/dist/esm/components/Wizard/WizardHeader.js.map +1 -1
  10. package/dist/js/components/Wizard/Wizard.d.ts +2 -0
  11. package/dist/js/components/Wizard/Wizard.d.ts.map +1 -1
  12. package/dist/js/components/Wizard/Wizard.js +3 -2
  13. package/dist/js/components/Wizard/Wizard.js.map +1 -1
  14. package/dist/js/components/Wizard/WizardHeader.d.ts +2 -0
  15. package/dist/js/components/Wizard/WizardHeader.d.ts.map +1 -1
  16. package/dist/js/components/Wizard/WizardHeader.js +2 -2
  17. package/dist/js/components/Wizard/WizardHeader.js.map +1 -1
  18. package/dist/umd/react-core.js +5 -4
  19. package/dist/umd/react-core.min.js +1 -1
  20. package/package.json +5 -5
  21. package/src/components/Dropdown/__tests__/DropdownToggleCheckbox.test.tsx +1 -1
  22. package/src/components/Page/__tests__/Page.test.tsx +225 -205
  23. package/src/components/Page/__tests__/__snapshots__/Page.test.tsx.snap +1088 -2059
  24. package/src/components/Pagination/__tests__/Pagination.test.tsx +235 -283
  25. package/src/components/Pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +143 -577
  26. package/src/components/Radio/__tests__/Radio.test.tsx +38 -44
  27. package/src/components/Radio/__tests__/__snapshots__/Radio.test.tsx.snap +30 -30
  28. package/src/components/SearchInput/__tests__/SearchInput.test.tsx +87 -68
  29. package/src/components/SearchInput/__tests__/__snapshots__/SearchInput.test.tsx.snap +230 -137
  30. package/src/components/Select/__tests__/Select.test.tsx +238 -195
  31. package/src/components/Select/__tests__/SelectToggle.test.tsx +68 -130
  32. package/src/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +978 -2149
  33. package/src/components/Select/__tests__/__snapshots__/SelectToggle.test.tsx.snap +3 -3
  34. package/src/components/SimpleList/__tests__/SimpleList.test.tsx +29 -32
  35. package/src/components/SimpleList/__tests__/__snapshots__/SimpleList.test.tsx.snap +4 -366
  36. package/src/components/Switch/__tests__/Switch.test.tsx +85 -75
  37. package/src/components/Switch/__tests__/__snapshots__/Switch.test.tsx.snap +30 -40
  38. package/src/components/TextArea/__tests__/TextArea.test.tsx +98 -103
  39. package/src/components/TextArea/__tests__/__snapshots__/TextArea.test.tsx.snap +24 -103
  40. package/src/components/TextInput/__tests__/TextInput.test.tsx +71 -70
  41. package/src/components/TextInput/__tests__/__snapshots__/TextInput.test.tsx.snap +15 -103
  42. package/src/components/TextInputGroup/__tests__/TextInputGroup.test.tsx +65 -39
  43. package/src/components/TextInputGroup/__tests__/__snapshots__/TextInputGroup.test.tsx.snap +53 -14
  44. package/src/components/TimePicker/__tests__/TimePicker.test.tsx +113 -110
  45. package/src/components/Title/__tests__/Title.test.tsx +21 -20
  46. package/src/components/Title/__tests__/__snapshots__/Title.test.tsx.snap +24 -30
  47. package/src/components/ToggleGroup/__tests__/ToggleGroup.test.tsx +43 -39
  48. package/src/components/ToggleGroup/__tests__/__snapshots__/ToggleGroup.test.tsx.snap +20 -19
  49. package/src/components/Wizard/Wizard.tsx +5 -0
  50. package/src/components/Wizard/WizardHeader.tsx +5 -2
  51. package/src/components/Wizard/__tests__/Wizard.test.tsx +195 -189
  52. package/src/components/Wizard/__tests__/__snapshots__/Wizard.test.tsx.snap +131 -10
  53. package/src/components/Wizard/examples/Wizard.md +168 -103
  54. package/src/helpers/__tests__/util.test.ts +113 -0
  55. package/src/layouts/Bullseye/__tests__/Bullseye.test.tsx +25 -25
  56. package/src/layouts/Bullseye/__tests__/__snapshots__/Bullseye.test.tsx.snap +3 -5
  57. package/src/layouts/Flex/__tests__/Flex.test.tsx +159 -96
  58. package/src/layouts/Flex/__tests__/__snapshots__/Flex.test.tsx.snap +9 -17
  59. package/src/components/AboutModal/__tests__/Generated/AboutModal.test.tsx +0 -27
  60. package/src/components/AboutModal/__tests__/Generated/AboutModalBox.test.tsx +0 -13
  61. package/src/components/AboutModal/__tests__/Generated/AboutModalBoxBrand.test.tsx +0 -13
  62. package/src/components/AboutModal/__tests__/Generated/AboutModalBoxCloseButton.test.tsx +0 -13
  63. package/src/components/AboutModal/__tests__/Generated/AboutModalBoxContent.test.tsx +0 -21
  64. package/src/components/AboutModal/__tests__/Generated/AboutModalBoxHeader.test.tsx +0 -13
  65. package/src/components/AboutModal/__tests__/Generated/AboutModalBoxHero.test.tsx +0 -13
  66. package/src/components/AboutModal/__tests__/Generated/AboutModalContainer.test.tsx +0 -27
  67. package/src/components/AboutModal/__tests__/Generated/__snapshots__/AboutModal.test.tsx.snap +0 -3
  68. package/src/components/AboutModal/__tests__/Generated/__snapshots__/AboutModalBox.test.tsx.snap +0 -15
  69. package/src/components/AboutModal/__tests__/Generated/__snapshots__/AboutModalBoxBrand.test.tsx.snap +0 -15
  70. package/src/components/AboutModal/__tests__/Generated/__snapshots__/AboutModalBoxCloseButton.test.tsx.snap +0 -33
  71. package/src/components/AboutModal/__tests__/Generated/__snapshots__/AboutModalBoxContent.test.tsx.snap +0 -27
  72. package/src/components/AboutModal/__tests__/Generated/__snapshots__/AboutModalBoxHeader.test.tsx.snap +0 -19
  73. package/src/components/AboutModal/__tests__/Generated/__snapshots__/AboutModalBoxHero.test.tsx.snap +0 -10
  74. package/src/components/AboutModal/__tests__/Generated/__snapshots__/AboutModalContainer.test.tsx.snap +0 -3
  75. package/src/components/Accordion/__tests__/Generated/Accordion.test.tsx +0 -22
  76. package/src/components/Accordion/__tests__/Generated/__snapshots__/Accordion.test.tsx.snap +0 -12
  77. package/src/components/Alert/__tests__/Generated/Alert.test.tsx +0 -26
  78. package/src/components/Alert/__tests__/Generated/__snapshots__/Alert.test.tsx.snap +0 -47
  79. package/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncher.test.tsx +0 -36
  80. package/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncher.test.tsx.snap +0 -30
  81. package/src/components/Avatar/__tests__/Generated/Avatar.test.tsx +0 -13
  82. package/src/components/Avatar/__tests__/Generated/__snapshots__/Avatar.test.tsx.snap +0 -11
  83. package/src/components/Backdrop/__tests__/Generated/Backdrop.test.tsx +0 -13
  84. package/src/components/Backdrop/__tests__/Generated/__snapshots__/Backdrop.test.tsx.snap +0 -11
  85. package/src/components/BackgroundImage/__tests__/Generated/BackgroundImage.test.tsx +0 -13
  86. package/src/components/BackgroundImage/__tests__/Generated/__snapshots__/BackgroundImage.test.tsx.snap +0 -47
  87. package/src/components/Badge/__tests__/Generated/Badge.test.tsx +0 -13
  88. package/src/components/Badge/__tests__/Generated/__snapshots__/Badge.test.tsx.snap +0 -9
  89. package/src/components/Brand/__tests__/Generated/Brand.test.tsx +0 -13
  90. package/src/components/Brand/__tests__/Generated/__snapshots__/Brand.test.tsx.snap +0 -11
  91. package/src/components/Breadcrumb/__tests__/Generated/Breadcrumb.test.tsx +0 -13
  92. package/src/components/Breadcrumb/__tests__/Generated/BreadcrumbHeading.test.tsx +0 -15
  93. package/src/components/Breadcrumb/__tests__/Generated/BreadcrumbItem.test.tsx +0 -22
  94. package/src/components/Breadcrumb/__tests__/Generated/__snapshots__/Breadcrumb.test.tsx.snap +0 -19
  95. package/src/components/Breadcrumb/__tests__/Generated/__snapshots__/BreadcrumbHeading.test.tsx.snap +0 -22
  96. package/src/components/Breadcrumb/__tests__/Generated/__snapshots__/BreadcrumbItem.test.tsx.snap +0 -17
  97. package/src/components/Button/__tests__/Generated/Button.test.tsx +0 -31
  98. package/src/components/Button/__tests__/Generated/__snapshots__/Button.test.tsx.snap +0 -17
  99. package/src/components/Card/__tests__/Generated/Card.test.tsx +0 -15
  100. package/src/components/Card/__tests__/Generated/CardBody.test.tsx +0 -13
  101. package/src/components/Card/__tests__/Generated/CardFooter.test.tsx +0 -13
  102. package/src/components/Card/__tests__/Generated/CardHead.test.tsx +0 -13
  103. package/src/components/Card/__tests__/Generated/CardHeader.test.tsx +0 -13
  104. package/src/components/Card/__tests__/Generated/__snapshots__/Card.test.tsx.snap +0 -15
  105. package/src/components/Card/__tests__/Generated/__snapshots__/CardBody.test.tsx.snap +0 -11
  106. package/src/components/Card/__tests__/Generated/__snapshots__/CardFooter.test.tsx.snap +0 -11
  107. package/src/components/Card/__tests__/Generated/__snapshots__/CardHead.test.tsx.snap +0 -11
  108. package/src/components/Card/__tests__/Generated/__snapshots__/CardHeader.test.tsx.snap +0 -11
  109. package/src/components/Checkbox/__tests__/Generated/Checkbox.test.tsx +0 -26
  110. package/src/components/Checkbox/__tests__/Generated/__snapshots__/Checkbox.test.tsx.snap +0 -35
  111. package/src/components/Chip/__tests__/Generated/Chip.test.tsx +0 -24
  112. package/src/components/Chip/__tests__/Generated/__snapshots__/Chip.test.tsx.snap +0 -46
  113. package/src/components/ChipGroup/__tests__/Generated/ChipGroup.test.tsx +0 -24
  114. package/src/components/ChipGroup/__tests__/Generated/__snapshots__/ChipGroup.test.tsx.snap +0 -33
  115. package/src/components/ClipboardCopy/__tests__/Generated/ClipboardCopyButton.test.tsx +0 -26
  116. package/src/components/ClipboardCopy/__tests__/Generated/ClipboardCopyExpanded.test.tsx +0 -21
  117. package/src/components/ClipboardCopy/__tests__/Generated/ClipboardCopyToggle.test.tsx +0 -22
  118. package/src/components/ClipboardCopy/__tests__/Generated/__snapshots__/ClipboardCopyButton.test.tsx.snap +0 -31
  119. package/src/components/ClipboardCopy/__tests__/Generated/__snapshots__/ClipboardCopyExpanded.test.tsx.snap +0 -14
  120. package/src/components/ClipboardCopy/__tests__/Generated/__snapshots__/ClipboardCopyToggle.test.tsx.snap +0 -32
  121. package/src/components/ContextSelector/__tests__/Generated/ContextSelector.test.tsx +0 -28
  122. package/src/components/ContextSelector/__tests__/Generated/ContextSelectorItem.test.tsx +0 -23
  123. package/src/components/ContextSelector/__tests__/Generated/ContextSelectorMenuList.test.tsx +0 -13
  124. package/src/components/ContextSelector/__tests__/Generated/ContextSelectorToggle.test.tsx +0 -26
  125. package/src/components/ContextSelector/__tests__/Generated/__snapshots__/ContextSelector.test.tsx.snap +0 -49
  126. package/src/components/ContextSelector/__tests__/Generated/__snapshots__/ContextSelectorItem.test.tsx.snap +0 -15
  127. package/src/components/ContextSelector/__tests__/Generated/__snapshots__/ContextSelectorMenuList.test.tsx.snap +0 -12
  128. package/src/components/ContextSelector/__tests__/Generated/__snapshots__/ContextSelectorToggle.test.tsx.snap +0 -35
  129. package/src/components/DataList/__tests__/Generated/DataList.test.tsx +0 -21
  130. package/src/components/DataList/__tests__/Generated/__snapshots__/DataList.test.tsx.snap +0 -12
  131. package/src/components/Divider/__tests__/Generated/Divider.test.tsx +0 -13
  132. package/src/components/Divider/__tests__/Generated/__snapshots__/Divider.test.tsx.snap +0 -9
  133. package/src/components/Drawer/__tests__/Generated/Drawer.test.tsx +0 -13
  134. package/src/components/Drawer/__tests__/Generated/__snapshots__/Drawer.test.tsx.snap +0 -13
  135. package/src/components/Dropdown/__tests__/Generated/Dropdown.test.tsx +0 -27
  136. package/src/components/Dropdown/__tests__/Generated/DropdownGroup.test.tsx +0 -13
  137. package/src/components/Dropdown/__tests__/Generated/DropdownToggle.test.tsx +0 -34
  138. package/src/components/Dropdown/__tests__/Generated/DropdownToggleAction.test.tsx +0 -22
  139. package/src/components/Dropdown/__tests__/Generated/DropdownToggleCheckbox.test.tsx +0 -25
  140. package/src/components/Dropdown/__tests__/Generated/Toggle.test.tsx +0 -31
  141. package/src/components/Dropdown/__tests__/Generated/__snapshots__/Dropdown.test.tsx.snap +0 -27
  142. package/src/components/Dropdown/__tests__/Generated/__snapshots__/DropdownGroup.test.tsx.snap +0 -16
  143. package/src/components/Dropdown/__tests__/Generated/__snapshots__/DropdownToggle.test.tsx.snap +0 -34
  144. package/src/components/Dropdown/__tests__/Generated/__snapshots__/DropdownToggleAction.test.tsx.snap +0 -15
  145. package/src/components/Dropdown/__tests__/Generated/__snapshots__/DropdownToggleCheckbox.test.tsx.snap +0 -30
  146. package/src/components/Dropdown/__tests__/Generated/__snapshots__/Toggle.test.tsx.snap +0 -17
  147. package/src/components/EmptyState/__tests__/Generated/EmptyState.test.tsx +0 -13
  148. package/src/components/EmptyState/__tests__/Generated/__snapshots__/EmptyState.test.tsx.snap +0 -17
  149. package/src/components/ExpandableSection/__tests__/Generated/ExpandableSection.test.tsx +0 -24
  150. package/src/components/ExpandableSection/__tests__/Generated/__snapshots__/ExpandableSection.test.tsx.snap +0 -46
  151. package/src/components/Form/__tests__/Generated/ActionGroup.test.tsx +0 -13
  152. package/src/components/Form/__tests__/Generated/Form.test.tsx +0 -13
  153. package/src/components/Form/__tests__/Generated/FormGroup.test.tsx +0 -27
  154. package/src/components/Form/__tests__/Generated/FormHelperText.test.tsx +0 -13
  155. package/src/components/Form/__tests__/Generated/__snapshots__/ActionGroup.test.tsx.snap +0 -19
  156. package/src/components/Form/__tests__/Generated/__snapshots__/Form.test.tsx.snap +0 -12
  157. package/src/components/Form/__tests__/Generated/__snapshots__/FormGroup.test.tsx.snap +0 -38
  158. package/src/components/Form/__tests__/Generated/__snapshots__/FormHelperText.test.tsx.snap +0 -11
  159. package/src/components/FormSelect/__tests__/Generated/FormSelect.test.tsx +0 -26
  160. package/src/components/FormSelect/__tests__/Generated/__snapshots__/FormSelect.test.tsx.snap +0 -18
  161. package/src/components/InputGroup/__tests__/Generated/InputGroup.test.tsx +0 -13
  162. package/src/components/InputGroup/__tests__/Generated/InputGroupText.test.tsx +0 -13
  163. package/src/components/InputGroup/__tests__/Generated/__snapshots__/InputGroup.test.tsx.snap +0 -13
  164. package/src/components/InputGroup/__tests__/Generated/__snapshots__/InputGroupText.test.tsx.snap +0 -13
  165. package/src/components/Label/__tests__/Generated/Label.test.tsx +0 -13
  166. package/src/components/Label/__tests__/Generated/__snapshots__/Label.test.tsx.snap +0 -17
  167. package/src/components/LabelGroup/__tests__/Generated/LabelGroup.test.tsx +0 -29
  168. package/src/components/LabelGroup/__tests__/Generated/__snapshots__/LabelGroup.test.tsx.snap +0 -34
  169. package/src/components/LoginPage/__tests__/Generated/Login.test.tsx +0 -13
  170. package/src/components/LoginPage/__tests__/Generated/LoginFooterItem.test.tsx +0 -13
  171. package/src/components/LoginPage/__tests__/Generated/LoginForm.test.tsx +0 -34
  172. package/src/components/LoginPage/__tests__/Generated/LoginMainBody.test.tsx +0 -13
  173. package/src/components/LoginPage/__tests__/Generated/LoginMainFooter.test.tsx +0 -21
  174. package/src/components/LoginPage/__tests__/Generated/LoginMainFooterBandItem.test.tsx +0 -13
  175. package/src/components/LoginPage/__tests__/Generated/LoginMainFooterLinksItem.test.tsx +0 -22
  176. package/src/components/LoginPage/__tests__/Generated/LoginMainHeader.test.tsx +0 -13
  177. package/src/components/LoginPage/__tests__/Generated/LoginPage.test.tsx +0 -30
  178. package/src/components/LoginPage/__tests__/Generated/__snapshots__/Login.test.tsx.snap +0 -19
  179. package/src/components/LoginPage/__tests__/Generated/__snapshots__/LoginFooterItem.test.tsx.snap +0 -7
  180. package/src/components/LoginPage/__tests__/Generated/__snapshots__/LoginForm.test.tsx.snap +0 -150
  181. package/src/components/LoginPage/__tests__/Generated/__snapshots__/LoginMainBody.test.tsx.snap +0 -11
  182. package/src/components/LoginPage/__tests__/Generated/__snapshots__/LoginMainFooter.test.tsx.snap +0 -11
  183. package/src/components/LoginPage/__tests__/Generated/__snapshots__/LoginMainFooterBandItem.test.tsx.snap +0 -11
  184. package/src/components/LoginPage/__tests__/Generated/__snapshots__/LoginMainFooterLinksItem.test.tsx.snap +0 -17
  185. package/src/components/LoginPage/__tests__/Generated/__snapshots__/LoginMainHeader.test.tsx.snap +0 -24
  186. package/src/components/LoginPage/__tests__/Generated/__snapshots__/LoginPage.test.tsx.snap +0 -60
  187. package/src/components/Modal/__tests__/Generated/Modal.test.tsx +0 -35
  188. package/src/components/Modal/__tests__/Generated/ModalBox.test.tsx +0 -22
  189. package/src/components/Modal/__tests__/Generated/ModalBoxBody.test.tsx +0 -13
  190. package/src/components/Modal/__tests__/Generated/ModalBoxCloseButton.test.tsx +0 -13
  191. package/src/components/Modal/__tests__/Generated/ModalBoxDescription.test.tsx +0 -13
  192. package/src/components/Modal/__tests__/Generated/ModalBoxFooter.test.tsx +0 -13
  193. package/src/components/Modal/__tests__/Generated/ModalBoxHeader.test.tsx +0 -13
  194. package/src/components/Modal/__tests__/Generated/ModalContent.test.tsx +0 -36
  195. package/src/components/Modal/__tests__/Generated/__snapshots__/Modal.test.tsx.snap +0 -3
  196. package/src/components/Modal/__tests__/Generated/__snapshots__/ModalBox.test.tsx.snap +0 -18
  197. package/src/components/Modal/__tests__/Generated/__snapshots__/ModalBoxBody.test.tsx.snap +0 -11
  198. package/src/components/Modal/__tests__/Generated/__snapshots__/ModalBoxCloseButton.test.tsx.snap +0 -29
  199. package/src/components/Modal/__tests__/Generated/__snapshots__/ModalBoxDescription.test.tsx.snap +0 -12
  200. package/src/components/Modal/__tests__/Generated/__snapshots__/ModalBoxFooter.test.tsx.snap +0 -11
  201. package/src/components/Modal/__tests__/Generated/__snapshots__/ModalBoxHeader.test.tsx.snap +0 -11
  202. package/src/components/Modal/__tests__/Generated/__snapshots__/ModalContent.test.tsx.snap +0 -3
  203. package/src/components/Nav/__tests__/Generated/Nav.test.tsx +0 -22
  204. package/src/components/Nav/__tests__/Generated/__snapshots__/Nav.test.tsx.snap +0 -15
  205. package/src/components/NotificationBadge/__tests__/Generated/NotificationBadge.test.tsx +0 -15
  206. package/src/components/NotificationBadge/__tests__/Generated/__snapshots__/NotificationBadge.test.tsx.snap +0 -23
  207. package/src/components/NotificationDrawer/__tests__/Generated/NotificationDrawer.test.tsx +0 -13
  208. package/src/components/NotificationDrawer/__tests__/Generated/NotificationDrawerBody.test.tsx +0 -13
  209. package/src/components/NotificationDrawer/__tests__/Generated/NotificationDrawerGroup.test.tsx +0 -23
  210. package/src/components/NotificationDrawer/__tests__/Generated/NotificationDrawerGroupList.test.tsx +0 -13
  211. package/src/components/NotificationDrawer/__tests__/Generated/NotificationDrawerHeader.test.tsx +0 -15
  212. package/src/components/NotificationDrawer/__tests__/Generated/NotificationDrawerList.test.tsx +0 -13
  213. package/src/components/NotificationDrawer/__tests__/Generated/NotificationDrawerListItem.test.tsx +0 -22
  214. package/src/components/NotificationDrawer/__tests__/Generated/NotificationDrawerListItemBody.test.tsx +0 -15
  215. package/src/components/NotificationDrawer/__tests__/Generated/NotificationDrawerListItemHeader.test.tsx +0 -22
  216. package/src/components/NotificationDrawer/__tests__/Generated/__snapshots__/NotificationDrawer.test.tsx.snap +0 -13
  217. package/src/components/NotificationDrawer/__tests__/Generated/__snapshots__/NotificationDrawerBody.test.tsx.snap +0 -13
  218. package/src/components/NotificationDrawer/__tests__/Generated/__snapshots__/NotificationDrawerGroup.test.tsx.snap +0 -51
  219. package/src/components/NotificationDrawer/__tests__/Generated/__snapshots__/NotificationDrawerGroupList.test.tsx.snap +0 -13
  220. package/src/components/NotificationDrawer/__tests__/Generated/__snapshots__/NotificationDrawerHeader.test.tsx.snap +0 -31
  221. package/src/components/NotificationDrawer/__tests__/Generated/__snapshots__/NotificationDrawerList.test.tsx.snap +0 -13
  222. package/src/components/NotificationDrawer/__tests__/Generated/__snapshots__/NotificationDrawerListItem.test.tsx.snap +0 -14
  223. package/src/components/NotificationDrawer/__tests__/Generated/__snapshots__/NotificationDrawerListItemBody.test.tsx.snap +0 -20
  224. package/src/components/NotificationDrawer/__tests__/Generated/__snapshots__/NotificationDrawerListItemHeader.test.tsx.snap +0 -44
  225. package/src/components/OptionsMenu/__tests__/Generated/OptionsMenu.test.tsx +0 -26
  226. package/src/components/OptionsMenu/__tests__/Generated/__snapshots__/OptionsMenu.test.tsx.snap +0 -24
  227. package/src/components/OverflowMenu/__tests__/Generated/OverflowMenu.test.tsx +0 -13
  228. package/src/components/OverflowMenu/__tests__/Generated/OverflowMenuContent.test.tsx +0 -13
  229. package/src/components/OverflowMenu/__tests__/Generated/OverflowMenuGroup.test.tsx +0 -15
  230. package/src/components/OverflowMenu/__tests__/Generated/OverflowMenuItem.test.tsx +0 -13
  231. package/src/components/OverflowMenu/__tests__/Generated/__snapshots__/OverflowMenu.test.tsx.snap +0 -11
  232. package/src/components/OverflowMenu/__tests__/Generated/__snapshots__/OverflowMenuContent.test.tsx.snap +0 -11
  233. package/src/components/OverflowMenu/__tests__/Generated/__snapshots__/OverflowMenuGroup.test.tsx.snap +0 -11
  234. package/src/components/OverflowMenu/__tests__/Generated/__snapshots__/OverflowMenuItem.test.tsx.snap +0 -13
  235. package/src/components/Page/__tests__/Generated/Page.test.tsx +0 -28
  236. package/src/components/Page/__tests__/Generated/PageHeader.test.tsx +0 -28
  237. package/src/components/Page/__tests__/Generated/PageSection.test.tsx +0 -22
  238. package/src/components/Page/__tests__/Generated/__snapshots__/Page.test.tsx.snap +0 -19
  239. package/src/components/Page/__tests__/Generated/__snapshots__/PageHeader.test.tsx.snap +0 -10
  240. package/src/components/Page/__tests__/Generated/__snapshots__/PageSection.test.tsx.snap +0 -13
  241. package/src/components/Pagination/__tests__/Generated/Pagination.test.tsx +0 -58
  242. package/src/components/Pagination/__tests__/Generated/__snapshots__/Pagination.test.tsx.snap +0 -205
  243. package/src/components/Popover/__tests__/Generated/Popover.test.tsx +0 -40
  244. package/src/components/Popover/__tests__/Generated/__snapshots__/Popover.test.tsx.snap +0 -9
  245. package/src/components/Progress/__tests__/Generated/Progress.test.tsx +0 -27
  246. package/src/components/Progress/__tests__/Generated/__snapshots__/Progress.test.tsx.snap +0 -63
  247. package/src/components/Radio/__tests__/Generated/Radio.test.tsx +0 -29
  248. package/src/components/Radio/__tests__/Generated/__snapshots__/Radio.test.tsx.snap +0 -36
  249. package/src/components/Select/__tests__/Generated/Select.test.tsx +0 -49
  250. package/src/components/Select/__tests__/Generated/SelectToggle.test.tsx +0 -34
  251. package/src/components/Select/__tests__/Generated/__snapshots__/Select.test.tsx.snap +0 -48
  252. package/src/components/Select/__tests__/Generated/__snapshots__/SelectToggle.test.tsx.snap +0 -36
  253. package/src/components/SimpleList/__tests__/Generated/SimpleList.test.tsx +0 -22
  254. package/src/components/SimpleList/__tests__/Generated/__snapshots__/SimpleList.test.tsx.snap +0 -13
  255. package/src/components/SkipToContent/__tests__/Generated/SkipToContent.test.tsx +0 -15
  256. package/src/components/SkipToContent/__tests__/Generated/__snapshots__/SkipToContent.test.tsx.snap +0 -15
  257. package/src/components/Spinner/__tests__/Generated/Spinner.test.tsx +0 -13
  258. package/src/components/Spinner/__tests__/Generated/__snapshots__/Spinner.test.tsx.snap +0 -22
  259. package/src/components/Switch/__tests__/Generated/Switch.test.tsx +0 -24
  260. package/src/components/Switch/__tests__/Generated/__snapshots__/Switch.test.tsx.snap +0 -36
  261. package/src/components/Tabs/__tests__/Generated/TabButton.test.tsx +0 -20
  262. package/src/components/Tabs/__tests__/Generated/Tabs.test.tsx +0 -29
  263. package/src/components/Tabs/__tests__/Generated/__snapshots__/TabButton.test.tsx.snap +0 -16
  264. package/src/components/Tabs/__tests__/Generated/__snapshots__/Tabs.test.tsx.snap +0 -75
  265. package/src/components/Text/__tests__/Generated/Text.test.tsx +0 -13
  266. package/src/components/Text/__tests__/Generated/__snapshots__/Text.test.tsx.snap +0 -15
  267. package/src/components/TextArea/__tests__/Generated/TextArea.test.tsx +0 -23
  268. package/src/components/TextArea/__tests__/Generated/__snapshots__/TextArea.test.tsx.snap +0 -13
  269. package/src/components/Title/__tests__/Generated/Title.test.tsx +0 -13
  270. package/src/components/Title/__tests__/Generated/__snapshots__/Title.test.tsx.snap +0 -12
  271. package/src/components/Toolbar/__tests__/Generated/Toolbar.test.tsx +0 -24
  272. package/src/components/Toolbar/__tests__/Generated/ToolbarItem.test.tsx +0 -20
  273. package/src/components/Toolbar/__tests__/Generated/__snapshots__/Toolbar.test.tsx.snap +0 -25
  274. package/src/components/Toolbar/__tests__/Generated/__snapshots__/ToolbarItem.test.tsx.snap +0 -14
  275. package/src/components/Tooltip/__tests__/Generated/Tooltip.test.tsx +0 -33
  276. package/src/components/Tooltip/__tests__/Generated/__snapshots__/Tooltip.test.tsx.snap +0 -9
  277. package/src/helpers/__tests__/util.test.js +0 -235
  278. package/src/layouts/Bullseye/__tests__/Generated/Bullseye.test.tsx +0 -13
  279. package/src/layouts/Bullseye/__tests__/Generated/__snapshots__/Bullseye.test.tsx.snap +0 -11
  280. package/src/layouts/Flex/__tests__/Generated/Flex.test.tsx +0 -13
  281. package/src/layouts/Flex/__tests__/Generated/__snapshots__/Flex.test.tsx.snap +0 -11
  282. package/src/layouts/Gallery/__tests__/Generated/Gallery.test.tsx +0 -13
  283. package/src/layouts/Gallery/__tests__/Generated/__snapshots__/Gallery.test.tsx.snap +0 -11
  284. package/src/layouts/Grid/__tests__/Generated/Grid.test.tsx +0 -15
  285. package/src/layouts/Grid/__tests__/Generated/GridItem.test.tsx +0 -36
  286. package/src/layouts/Grid/__tests__/Generated/__snapshots__/Grid.test.tsx.snap +0 -11
  287. package/src/layouts/Grid/__tests__/Generated/__snapshots__/GridItem.test.tsx.snap +0 -11
  288. package/src/layouts/Level/__tests__/Generated/Level.test.tsx +0 -13
  289. package/src/layouts/Level/__tests__/Generated/__snapshots__/Level.test.tsx.snap +0 -11
  290. package/src/layouts/Split/__tests__/Generated/Split.test.tsx +0 -13
  291. package/src/layouts/Split/__tests__/Generated/__snapshots__/Split.test.tsx.snap +0 -11
  292. package/src/layouts/Stack/__tests__/Generated/Stack.test.tsx +0 -13
  293. package/src/layouts/Stack/__tests__/Generated/__snapshots__/Stack.test.tsx.snap +0 -11
@@ -1,332 +1,284 @@
1
1
  import React from 'react';
2
- import { render } from '@testing-library/react';
3
- import { mount } from 'enzyme';
4
- import { Pagination, PaginationVariant } from '../index';
5
-
6
- describe('component render', () => {
7
- test('should render correctly top', () => {
8
- const wrapper = render(<Pagination itemCount={20} />);
9
- expect(wrapper.container).toMatchSnapshot();
10
- });
11
2
 
12
- test('should render correctly bottom', () => {
13
- const wrapper = render(<Pagination itemCount={20} variant={PaginationVariant.bottom} />);
14
- expect(wrapper.container).toMatchSnapshot();
15
- });
16
-
17
- test('should render correctly compact', () => {
18
- const wrapper = render(<Pagination itemCount={20} isCompact />);
19
- expect(wrapper.container).toMatchSnapshot();
20
- });
3
+ import { render, screen } from '@testing-library/react';
4
+ import userEvent from '@testing-library/user-event';
5
+ import '@testing-library/jest-dom';
21
6
 
22
- test('should render correctly sticky', () => {
23
- const wrapper = render(<Pagination itemCount={20} isSticky />);
24
- expect(wrapper.container).toMatchSnapshot();
25
- });
26
-
27
- test('should render correctly bottom sticky', () => {
28
- const wrapper = render(<Pagination itemCount={20} variant={PaginationVariant.bottom} isSticky />);
29
- expect(wrapper.container).toMatchSnapshot();
30
- });
31
-
32
- test('should render correctly disabled', () => {
33
- const wrapper = render(<Pagination itemCount={20} isDisabled />);
34
- expect(wrapper.container).toMatchSnapshot();
35
- });
36
-
37
- test('limited number of pages', () => {
38
- const wrapper = render(<Pagination itemCount={20} perPage={20} />);
39
- expect(wrapper.container).toMatchSnapshot();
40
- });
41
-
42
- test('zero results', () => {
43
- const wrapper = render(<Pagination itemCount={0} />);
44
- expect(wrapper.container).toMatchSnapshot();
45
- });
46
-
47
- test('last page', () => {
48
- const wrapper = render(<Pagination itemCount={20} perPage={10} page={2} />);
49
- expect(wrapper.container).toMatchSnapshot();
50
- });
51
-
52
- test('custom perPageOptions', () => {
53
- const wrapper = render(<Pagination itemCount={40} perPageOptions={[{ title: 'some', value: 1 }]} />);
54
- expect(wrapper.container).toMatchSnapshot();
55
- });
56
-
57
- test('empty per page options', () => {
58
- const wrapper = render(<Pagination itemCount={40} perPageOptions={[]} />);
59
- expect(wrapper.container).toMatchSnapshot();
60
- });
61
-
62
- test('no items', () => {
63
- const wrapper = render(<Pagination itemCount={0} />);
64
- expect(wrapper.container).toMatchSnapshot();
65
- });
66
-
67
- test('custom start end', () => {
68
- const wrapper = render(<Pagination itemCount={40} itemsStart={5} itemsEnd={15} />);
69
- expect(wrapper.container).toMatchSnapshot();
70
- });
71
-
72
- test('titles', () => {
73
- const wrapper = render(<Pagination itemCount={40} titles={{ items: 'values', page: 'books' }} />);
74
- expect(wrapper.container).toMatchSnapshot();
75
- });
7
+ import { Pagination, PaginationVariant } from '../index';
76
8
 
77
- test('custom pagination toggle', () => {
78
- const wrapper = render(
79
- // eslint-disable-next-line no-template-curly-in-string
80
- <Pagination itemCount={40} toggleTemplate={'${firstIndex} - ${lastIndex} - ${itemCount} - ${itemsTitle}'} />
81
- );
82
- expect(wrapper.container).toMatchSnapshot();
83
- });
9
+ describe('Pagination', () => {
10
+ describe('component render', () => {
11
+ test('should render correctly top', () => {
12
+ const { asFragment } = render(<Pagination itemCount={20} />);
13
+ expect(asFragment()).toMatchSnapshot();
14
+ });
84
15
 
85
- test('up drop direction', () => {
86
- const wrapper = render(<Pagination itemCount={40} dropDirection="up" />);
87
- expect(wrapper.container).toMatchSnapshot();
88
- });
16
+ test('should render correctly bottom', () => {
17
+ const { asFragment } = render(<Pagination itemCount={20} variant={PaginationVariant.bottom} />);
18
+ expect(asFragment()).toMatchSnapshot();
19
+ });
89
20
 
90
- test('indeterminate count (no item count)', () => {
91
- const toggle = mount(
92
- <Pagination />
93
- ).find('span.pf-c-options-menu__toggle-text');
94
- expect(toggle.find('b').at(0).text()).toBe('1 - 10');
95
- expect(toggle).toMatchSnapshot();
96
- });
21
+ test('should render correctly compact', () => {
22
+ const { asFragment } = render(<Pagination itemCount={20} isCompact />);
23
+ expect(asFragment()).toMatchSnapshot();
24
+ });
97
25
 
98
- test('toggleTemplate toggle text with function', () => {
99
- const toggle = mount(
100
- <Pagination toggleTemplate={({ firstIndex, lastIndex }) => (<div>{firstIndex} - {lastIndex} of many</div>)} />
101
- ).find('span.pf-c-options-menu__toggle-text');
102
- expect(toggle.find('div').text()).toBe('1 - 10 of many');
103
- expect(toggle).toMatchSnapshot();
104
- });
26
+ test('should render correctly sticky', () => {
27
+ const { asFragment } = render(<Pagination itemCount={20} isSticky />);
28
+ expect(asFragment()).toMatchSnapshot();
29
+ });
105
30
 
106
- test('toggleTemplate toggle text with string', () => {
107
- const toggle = mount(
108
- <Pagination toggleTemplate={'I am a string'} />
109
- ).find('span.pf-c-options-menu__toggle-text');
110
- expect(toggle.text()).toBe('I am a string');
111
- expect(toggle).toMatchSnapshot();
112
- });
113
- });
31
+ test('should render correctly bottom sticky', () => {
32
+ const { asFragment } = render(<Pagination itemCount={20} variant={PaginationVariant.bottom} isSticky />);
33
+ expect(asFragment()).toMatchSnapshot();
34
+ });
114
35
 
115
- describe('API', () => {
116
- describe('onSetPage', () => {
117
- const onSetPage = jest.fn();
118
-
119
- test('should call first', () => {
120
- const wrapper = mount(<Pagination onSetPage={onSetPage} itemCount={40} page={2} />);
121
- wrapper
122
- .find('[data-action="first"]')
123
- .first()
124
- .simulate('click');
125
- expect(onSetPage.mock.calls).toHaveLength(1);
126
- expect(onSetPage.mock.calls[0][1]).toBe(1);
36
+ test('should render correctly disabled', () => {
37
+ const { asFragment } = render(<Pagination itemCount={20} isDisabled />);
38
+ expect(asFragment()).toMatchSnapshot();
127
39
  });
128
40
 
129
- test('should call previous', () => {
130
- const wrapper = mount(<Pagination onSetPage={onSetPage} itemCount={40} page={3} />);
131
- wrapper
132
- .find('[data-action="previous"]')
133
- .first()
134
- .simulate('click');
135
- expect(onSetPage.mock.calls).toHaveLength(1);
136
- expect(onSetPage.mock.calls[0][1]).toBe(2);
41
+ test('limited number of pages', () => {
42
+ const { asFragment } = render(<Pagination itemCount={20} perPage={20} />);
43
+ expect(asFragment()).toMatchSnapshot();
137
44
  });
138
45
 
139
- test('should call next', () => {
140
- const wrapper = mount(<Pagination onSetPage={onSetPage} itemCount={40} />);
141
- wrapper
142
- .find('[data-action="next"]')
143
- .first()
144
- .simulate('click');
145
- expect(onSetPage.mock.calls).toHaveLength(1);
146
- expect(onSetPage.mock.calls[0][1]).toBe(2);
46
+ test('zero results', () => {
47
+ const { asFragment } = render(<Pagination itemCount={0} />);
48
+ expect(asFragment()).toMatchSnapshot();
147
49
  });
148
50
 
149
- test('should call last', () => {
150
- const wrapper = mount(<Pagination onSetPage={onSetPage} itemCount={40} />);
151
- wrapper
152
- .find('[data-action="last"]')
153
- .first()
154
- .simulate('click');
155
- expect(onSetPage.mock.calls).toHaveLength(1);
156
- expect(onSetPage.mock.calls[0][1]).toBe(4);
51
+ test('last page', () => {
52
+ const { asFragment } = render(<Pagination itemCount={20} perPage={10} page={2} />);
53
+ expect(asFragment()).toMatchSnapshot();
157
54
  });
158
55
 
159
- test('should call input', () => {
160
- const wrapper = mount(<Pagination onSetPage={onSetPage} itemCount={40} />);
161
- wrapper
162
- .find('input')
163
- .first()
164
- .simulate('change', { target: { value: '1' } })
165
- .simulate('keydown', { keyCode: 13 });
166
- expect(onSetPage.mock.calls).toHaveLength(1);
167
- expect(onSetPage.mock.calls[0][1]).toBe(1);
56
+ test('custom perPageOptions', () => {
57
+ const { asFragment } = render(<Pagination itemCount={40} perPageOptions={[{ title: 'some', value: 1 }]} />);
58
+ expect(asFragment()).toMatchSnapshot();
168
59
  });
169
60
 
170
- test('should call input wrong value', () => {
171
- const wrapper = mount(<Pagination onSetPage={onSetPage} itemCount={40} />);
172
- wrapper
173
- .find('input')
174
- .first()
175
- .simulate('change', { target: { value: 'a' } })
176
- .simulate('keydown', { keyCode: 13 });
177
- expect(onSetPage.mock.calls).toHaveLength(1);
178
- expect(onSetPage.mock.calls[0][1]).toBe(1);
61
+ test('empty per page options', () => {
62
+ const { asFragment } = render(<Pagination itemCount={40} perPageOptions={[]} />);
63
+ expect(asFragment()).toMatchSnapshot();
179
64
  });
180
65
 
181
- test('should call input huge page number', () => {
182
- const wrapper = mount(<Pagination onSetPage={onSetPage} itemCount={40} />);
183
- wrapper
184
- .find('input')
185
- .first()
186
- .simulate('change', { target: { value: '10' } })
187
- .simulate('keydown', { keyCode: 13 });
188
- expect(onSetPage.mock.calls).toHaveLength(1);
189
- expect(onSetPage.mock.calls[0][1]).toBe(4);
66
+ test('custom start end', () => {
67
+ const { asFragment } = render(<Pagination itemCount={40} itemsStart={5} itemsEnd={15} />);
68
+ expect(asFragment()).toMatchSnapshot();
190
69
  });
191
70
 
192
- test('should call input small page number', () => {
193
- const wrapper = mount(<Pagination onSetPage={onSetPage} itemCount={40} />);
194
- wrapper
195
- .find('input')
196
- .first()
197
- .simulate('change', { target: { value: '-10' } })
198
- .simulate('keydown', { keyCode: 13 });
199
- expect(onSetPage.mock.calls).toHaveLength(1);
200
- expect(onSetPage.mock.calls[0][1]).toBe(1);
71
+ test('titles', () => {
72
+ const { asFragment } = render(<Pagination itemCount={40} titles={{ items: 'values', page: 'books' }} />);
73
+ expect(asFragment()).toMatchSnapshot();
201
74
  });
202
75
 
203
- test('should NOT call', () => {
204
- const wrapper = mount(<Pagination itemCount={40} />);
205
- wrapper
206
- .find('[data-action="last"]')
207
- .first()
208
- .simulate('click');
209
- expect(onSetPage.mock.calls).toHaveLength(0);
76
+ test('custom pagination toggle', () => {
77
+ const { asFragment } = render(
78
+ <Pagination
79
+ itemCount={40}
80
+ toggleTemplate={'${firstIndex} - ${lastIndex} - ${itemCount} - ${itemsTitle}'}
81
+ />
82
+ );
83
+ expect(asFragment()).toMatchSnapshot();
210
84
  });
211
- });
212
85
 
213
- describe('onFirst', () => {
214
- const onFirst = jest.fn();
215
- test('should call', () => {
216
- const wrapper = mount(<Pagination onFirstClick={onFirst} itemCount={40} page={2} />);
217
- wrapper
218
- .find('[data-action="first"]')
219
- .first()
220
- .simulate('click');
221
- expect(onFirst.mock.calls).toHaveLength(1);
222
- expect(onFirst.mock.calls[0][1]).toBe(1);
86
+ test('up drop direction', () => {
87
+ const { asFragment } = render(<Pagination itemCount={40} dropDirection="up" />);
88
+ expect(asFragment()).toMatchSnapshot();
223
89
  });
224
90
 
225
- test('should NOT call', () => {
226
- const wrapper = mount(<Pagination itemCount={40} page={2} />);
227
- wrapper
228
- .find('[data-action="first"]')
229
- .first()
230
- .simulate('click');
231
- expect(onFirst.mock.calls).toHaveLength(0);
91
+ test('indeterminate count (no item count)', () => {
92
+ render(<Pagination />);
93
+ expect(screen.getAllByText('1 - 10')[0]).toBeInTheDocument();
232
94
  });
233
- });
234
95
 
235
- describe('onLast', () => {
236
- const onLast = jest.fn();
237
- test('should call', () => {
238
- const wrapper = mount(<Pagination onLastClick={onLast} itemCount={40} />);
239
- wrapper
240
- .find('[data-action="last"]')
241
- .first()
242
- .simulate('click');
243
- expect(onLast.mock.calls).toHaveLength(1);
244
- expect(onLast.mock.calls[0][1]).toBe(4);
96
+ test('toggleTemplate toggle text with function', () => {
97
+ render(
98
+ <Pagination
99
+ toggleTemplate={({ firstIndex, lastIndex }) => (
100
+ <div>
101
+ {firstIndex} - {lastIndex} of many
102
+ </div>
103
+ )}
104
+ />
105
+ );
106
+ expect(screen.getAllByText('1 - 10 of many')[0]).toBeInTheDocument();
245
107
  });
246
108
 
247
- test('should NOT call', () => {
248
- const wrapper = mount(<Pagination itemCount={40} />);
249
- wrapper
250
- .find('[data-action="last"]')
251
- .first()
252
- .simulate('click');
253
- expect(onLast.mock.calls).toHaveLength(0);
109
+ test('toggleTemplate toggle text with string', () => {
110
+ render(<Pagination toggleTemplate={'I am a string'} />);
111
+ expect(screen.getAllByText('I am a string')[0]).toBeInTheDocument();
254
112
  });
255
113
  });
256
114
 
257
- describe('onPrevious', () => {
258
- const onPrevious = jest.fn();
259
- test('should call', () => {
260
- const wrapper = mount(<Pagination onPreviousClick={onPrevious} itemCount={40} page={3} />);
261
- wrapper
262
- .find('[data-action="previous"]')
263
- .first()
264
- .simulate('click');
265
- expect(onPrevious.mock.calls).toHaveLength(1);
266
- expect(onPrevious.mock.calls[0][1]).toBe(2);
115
+ describe('API', () => {
116
+ describe('onSetPage', () => {
117
+ const onSetPage = jest.fn();
118
+
119
+ test('should call first', () => {
120
+ render(<Pagination onSetPage={onSetPage} itemCount={40} page={2} />);
121
+
122
+ userEvent.click(screen.getByRole('button', { name: 'Go to first page' }));
123
+ expect(onSetPage).toHaveBeenCalled();
124
+ });
125
+
126
+ test('should call previous', () => {
127
+ render(<Pagination onSetPage={onSetPage} itemCount={40} page={3} />);
128
+
129
+ userEvent.click(screen.getByRole('button', { name: 'Go to previous page' }));
130
+ expect(onSetPage).toHaveBeenCalled();
131
+ });
132
+
133
+ test('should call next', () => {
134
+ render(<Pagination onSetPage={onSetPage} itemCount={40} />);
135
+
136
+ userEvent.click(screen.getByRole('button', { name: 'Go to next page' }));
137
+ expect(onSetPage).toHaveBeenCalled();
138
+ });
139
+
140
+ test('should call last', () => {
141
+ render(<Pagination onSetPage={onSetPage} itemCount={40} />);
142
+
143
+ userEvent.click(screen.getByRole('button', { name: 'Go to last page' }));
144
+ expect(onSetPage).toHaveBeenCalled();
145
+ });
146
+
147
+ test('should call input', () => {
148
+ render(<Pagination onSetPage={onSetPage} itemCount={40} />);
149
+
150
+ const input = screen.getByLabelText('Current page');
151
+ userEvent.type(input, '1');
152
+ userEvent.type(input, '{enter}');
153
+
154
+ expect(onSetPage).toHaveBeenCalled();
155
+ });
156
+
157
+ test('should call input wrong value', () => {
158
+ render(<Pagination onSetPage={onSetPage} itemCount={40} />);
159
+
160
+ const input = screen.getByLabelText('Current page');
161
+ userEvent.type(input, 'a');
162
+ userEvent.type(input, '{enter}');
163
+
164
+ expect(onSetPage).toHaveBeenCalled();
165
+ });
166
+
167
+ test('should call input huge page number', () => {
168
+ render(<Pagination onSetPage={onSetPage} itemCount={40} />);
169
+
170
+ const input = screen.getByLabelText('Current page');
171
+ userEvent.type(input, '10');
172
+ userEvent.type(input, '{enter}');
173
+
174
+ expect(onSetPage).toHaveBeenCalled();
175
+ });
176
+
177
+ test('should call input small page number', () => {
178
+ render(<Pagination onSetPage={onSetPage} itemCount={40} />);
179
+
180
+ const input = screen.getByLabelText('Current page');
181
+ userEvent.type(input, '-10');
182
+ userEvent.type(input, '{enter}');
183
+
184
+ expect(onSetPage).toHaveBeenCalled();
185
+ });
186
+
187
+ test('should NOT call', () => {
188
+ render(<Pagination itemCount={40} />);
189
+
190
+ userEvent.click(screen.getByRole('button', { name: 'Go to last page' }));
191
+ expect(onSetPage).not.toHaveBeenCalled();
192
+ });
267
193
  });
268
194
 
269
- test('should NOT call', () => {
270
- const wrapper = mount(<Pagination itemCount={40} />);
271
- wrapper
272
- .find('[data-action="previous"]')
273
- .first()
274
- .simulate('click');
275
- expect(onPrevious.mock.calls).toHaveLength(0);
195
+ describe('onFirst', () => {
196
+ const onFirst = jest.fn();
197
+ test('should call', () => {
198
+ render(<Pagination onFirstClick={onFirst} itemCount={40} page={2} />);
199
+
200
+ userEvent.click(screen.getByRole('button', { name: 'Go to first page' }));
201
+ expect(onFirst).toHaveBeenCalled();
202
+ });
203
+
204
+ test('should NOT call', () => {
205
+ render(<Pagination itemCount={40} page={2} />);
206
+
207
+ userEvent.click(screen.getByRole('button', { name: 'Go to first page' }));
208
+ expect(onFirst).not.toHaveBeenCalled();
209
+ });
276
210
  });
277
- });
278
211
 
279
- describe('onNext', () => {
280
- const onNext = jest.fn();
281
- test('should call', () => {
282
- const wrapper = mount(<Pagination onNextClick={onNext} itemCount={40} />);
283
- wrapper
284
- .find('[data-action="next"]')
285
- .first()
286
- .simulate('click');
287
- expect(onNext.mock.calls).toHaveLength(1);
288
- expect(onNext.mock.calls[0][1]).toBe(2);
212
+ describe('onLast', () => {
213
+ const onLast = jest.fn();
214
+ test('should call', () => {
215
+ render(<Pagination onLastClick={onLast} itemCount={40} />);
216
+
217
+ userEvent.click(screen.getByRole('button', { name: 'Go to last page' }));
218
+ expect(onLast).toHaveBeenCalled();
219
+ });
220
+
221
+ test('should NOT call', () => {
222
+ render(<Pagination itemCount={40} />);
223
+
224
+ userEvent.click(screen.getByRole('button', { name: 'Go to last page' }));
225
+ expect(onLast).not.toHaveBeenCalled();
226
+ });
289
227
  });
290
228
 
291
- test('should NOT call', () => {
292
- const wrapper = mount(<Pagination itemCount={40} />);
293
- wrapper
294
- .find('[data-action="previous"]')
295
- .first()
296
- .simulate('click');
297
- expect(onNext.mock.calls).toHaveLength(0);
229
+ describe('onPrevious', () => {
230
+ const onPrevious = jest.fn();
231
+ test('should call', () => {
232
+ render(<Pagination onPreviousClick={onPrevious} itemCount={40} page={3} />);
233
+
234
+ userEvent.click(screen.getByRole('button', { name: 'Go to previous page' }));
235
+ expect(onPrevious).toHaveBeenCalled();
236
+ });
237
+
238
+ test('should NOT call', () => {
239
+ render(<Pagination itemCount={40} />);
240
+
241
+ userEvent.click(screen.getByRole('button', { name: 'Go to previous page' }));
242
+ expect(onPrevious).not.toHaveBeenCalled();
243
+ });
298
244
  });
299
- });
300
245
 
301
- describe('onPerPage', () => {
302
- const onPerPage = jest.fn();
303
- test('should call', () => {
304
- const wrapper = mount(<Pagination onPerPageSelect={onPerPage} itemCount={40} />);
305
- wrapper
306
- .find('.pf-c-options-menu button')
307
- .first()
308
- .simulate('click');
309
- wrapper.update();
310
- wrapper
311
- .find('ul li [data-action="per-page-20"]')
312
- .first()
313
- .simulate('click');
314
- expect(onPerPage.mock.calls).toHaveLength(1);
315
- expect(onPerPage.mock.calls[0][1]).toBe(20);
246
+ describe('onNext', () => {
247
+ const onNext = jest.fn();
248
+ test('should call', () => {
249
+ render(<Pagination onNextClick={onNext} itemCount={40} />);
250
+
251
+ userEvent.click(screen.getByRole('button', { name: 'Go to next page' }));
252
+ expect(onNext).toHaveBeenCalled();
253
+ });
254
+
255
+ test('should NOT call', () => {
256
+ render(<Pagination itemCount={40} />);
257
+
258
+ userEvent.click(screen.getByRole('button', { name: 'Go to previous page' }));
259
+ expect(onNext).not.toHaveBeenCalled();
260
+ });
316
261
  });
317
262
 
318
- test('should NOT call', () => {
319
- const wrapper = mount(<Pagination itemCount={40} />);
320
- wrapper
321
- .find('.pf-c-options-menu button')
322
- .first()
323
- .simulate('click');
324
- wrapper.update();
325
- wrapper
326
- .find('ul li [data-action="per-page-20"]')
327
- .first()
328
- .simulate('click');
329
- expect(onPerPage.mock.calls).toHaveLength(0);
263
+ describe('onPerPage', () => {
264
+ const onPerPage = jest.fn();
265
+ test('should call', () => {
266
+ render(<Pagination onPerPageSelect={onPerPage} itemCount={40} />);
267
+
268
+ userEvent.click(screen.getByRole('button', { name: 'Items per page' }));
269
+ userEvent.click(screen.getByText('20 per page'));
270
+
271
+ expect(onPerPage).toHaveBeenCalled();
272
+ });
273
+
274
+ test('should NOT call', () => {
275
+ render(<Pagination itemCount={40} />);
276
+
277
+ userEvent.click(screen.getByRole('button', { name: 'Items per page' }));
278
+ userEvent.click(screen.getByText('20 per page'));
279
+
280
+ expect(onPerPage).not.toHaveBeenCalled();
281
+ });
330
282
  });
331
283
  });
332
284
  });