@amsterdam/design-system-react 2.1.0 → 3.0.0

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 (279) hide show
  1. package/README.md +1 -1
  2. package/dist/Avatar/Avatar.d.ts +2 -2
  3. package/dist/Card/Card.d.ts +1 -1
  4. package/dist/Card/CardHeading.d.ts +1 -1
  5. package/dist/Checkbox/Checkbox.d.ts +1 -1
  6. package/dist/Column/Column.d.ts +1 -1
  7. package/dist/DateInput/DateInput.d.ts +1 -1
  8. package/dist/FieldSet/FieldSet.d.ts +11 -0
  9. package/dist/FieldSet/FieldSet.js +3 -3
  10. package/dist/Grid/Grid.d.ts +1 -1
  11. package/dist/Grid/GridCell.d.ts +1 -1
  12. package/dist/Hint/Hint.d.ts +1 -0
  13. package/dist/Hint/Hint.js +2 -2
  14. package/dist/Image/Image.js +1 -1
  15. package/dist/Label/Label.d.ts +11 -0
  16. package/dist/Label/Label.js +2 -2
  17. package/dist/LinkList/LinkList.d.ts +1 -1
  18. package/dist/Logo/Logo.d.ts +10 -5
  19. package/dist/Logo/Logo.js +17 -9
  20. package/dist/Menu/MenuLink.d.ts +2 -2
  21. package/dist/Page/Page.d.ts +6 -2
  22. package/dist/Page/Page.js +1 -1
  23. package/dist/PageFooter/PageFooter.d.ts +4 -1
  24. package/dist/PageFooter/PageFooterMenu.d.ts +27 -2
  25. package/dist/PageFooter/PageFooterMenu.js +6 -2
  26. package/dist/PageHeader/PageHeader.d.ts +14 -4
  27. package/dist/PageHeader/PageHeader.js +3 -2
  28. package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.js +2 -1
  29. package/dist/PageHeader/PageHeaderMenuIcon.js +1 -1
  30. package/dist/PageHeader/PageHeaderMenuLink.d.ts +7 -0
  31. package/dist/PageHeader/PageHeaderMenuLink.js +3 -2
  32. package/dist/Paragraph/Paragraph.d.ts +2 -2
  33. package/dist/Paragraph/Paragraph.js +8 -1
  34. package/dist/PasswordInput/PasswordInput.d.ts +1 -1
  35. package/dist/Radio/Radio.d.ts +1 -1
  36. package/dist/Row/Row.d.ts +1 -1
  37. package/dist/SearchField/SearchField.d.ts +1 -1
  38. package/dist/Spotlight/Spotlight.d.ts +1 -1
  39. package/dist/TimeInput/TimeInput.d.ts +1 -1
  40. package/dist/common/useIsAfterBreakpoint.d.ts +4 -4
  41. package/dist/common/useIsAfterBreakpoint.js +12 -13
  42. package/dist/index.cjs.js +95 -62
  43. package/dist/index.cjs.js.map +1 -1
  44. package/dist/index.d.ts +1958 -61
  45. package/dist/index.esm.js +96 -63
  46. package/dist/index.esm.js.map +1 -1
  47. package/dist/tsconfig.build.tsbuildinfo +1 -1
  48. package/package.json +11 -16
  49. package/dist/Accordion/Accordion.test.d.ts +0 -5
  50. package/dist/Accordion/Accordion.test.js +0 -44
  51. package/dist/Accordion/AccordionSection.test.d.ts +0 -5
  52. package/dist/Accordion/AccordionSection.test.js +0 -100
  53. package/dist/ActionGroup/ActionGroup.test.d.ts +0 -5
  54. package/dist/ActionGroup/ActionGroup.test.js +0 -33
  55. package/dist/Alert/Alert.test.d.ts +0 -5
  56. package/dist/Alert/Alert.test.js +0 -74
  57. package/dist/App/App.d.ts +0 -12
  58. package/dist/App/App.js +0 -8
  59. package/dist/App/App.test.d.ts +0 -5
  60. package/dist/App/App.test.js +0 -33
  61. package/dist/App/index.d.ts +0 -6
  62. package/dist/App/index.js +0 -5
  63. package/dist/AppNavigation/AppNavigation.d.ts +0 -45
  64. package/dist/AppNavigation/AppNavigation.js +0 -18
  65. package/dist/AppNavigation/AppNavigation.test.d.ts +0 -5
  66. package/dist/AppNavigation/AppNavigation.test.js +0 -33
  67. package/dist/AppNavigation/AppNavigationButton.d.ts +0 -18
  68. package/dist/AppNavigation/AppNavigationButton.js +0 -17
  69. package/dist/AppNavigation/AppNavigationLink.d.ts +0 -19
  70. package/dist/AppNavigation/AppNavigationLink.js +0 -19
  71. package/dist/AppNavigation/AppNavigationMenu.d.ts +0 -9
  72. package/dist/AppNavigation/AppNavigationMenu.js +0 -5
  73. package/dist/AppNavigation/index.d.ts +0 -6
  74. package/dist/AppNavigation/index.js +0 -5
  75. package/dist/Avatar/Avatar.test.d.ts +0 -5
  76. package/dist/Avatar/Avatar.test.js +0 -63
  77. package/dist/Badge/Badge.test.d.ts +0 -5
  78. package/dist/Badge/Badge.test.js +0 -43
  79. package/dist/Blockquote/Blockquote.test.d.ts +0 -5
  80. package/dist/Blockquote/Blockquote.test.js +0 -46
  81. package/dist/Breadcrumb/Breadcrumb.test.d.ts +0 -5
  82. package/dist/Breadcrumb/Breadcrumb.test.js +0 -45
  83. package/dist/Breadcrumb/BreadcrumbLink.test.d.ts +0 -5
  84. package/dist/Breadcrumb/BreadcrumbLink.test.js +0 -40
  85. package/dist/Breakout/Breakout.test.d.ts +0 -5
  86. package/dist/Breakout/Breakout.test.js +0 -62
  87. package/dist/Breakout/BreakoutCell.test.d.ts +0 -5
  88. package/dist/Breakout/BreakoutCell.test.js +0 -128
  89. package/dist/Button/Button.test.d.ts +0 -5
  90. package/dist/Button/Button.test.js +0 -114
  91. package/dist/CallToActionLink/CallToActionLink.test.d.ts +0 -5
  92. package/dist/CallToActionLink/CallToActionLink.test.js +0 -33
  93. package/dist/Card/Card.test.d.ts +0 -5
  94. package/dist/Card/Card.test.js +0 -33
  95. package/dist/Card/CardHeading.test.d.ts +0 -5
  96. package/dist/Card/CardHeading.test.js +0 -38
  97. package/dist/Card/CardHeadingGroup.test.d.ts +0 -5
  98. package/dist/Card/CardHeadingGroup.test.js +0 -38
  99. package/dist/Card/CardImage.test.d.ts +0 -5
  100. package/dist/Card/CardImage.test.js +0 -33
  101. package/dist/Card/CardLink.test.d.ts +0 -5
  102. package/dist/Card/CardLink.test.js +0 -33
  103. package/dist/CharacterCount/CharacterCount.test.d.ts +0 -5
  104. package/dist/CharacterCount/CharacterCount.test.js +0 -38
  105. package/dist/Checkbox/Checkbox.test.d.ts +0 -5
  106. package/dist/Checkbox/Checkbox.test.js +0 -142
  107. package/dist/Column/Column.test.d.ts +0 -5
  108. package/dist/Column/Column.test.js +0 -59
  109. package/dist/DateInput/DateInput.test.d.ts +0 -5
  110. package/dist/DateInput/DateInput.test.js +0 -58
  111. package/dist/DescriptionList/DescriptionList.test.d.ts +0 -5
  112. package/dist/DescriptionList/DescriptionList.test.js +0 -43
  113. package/dist/DescriptionList/DescriptionListDescription.test.d.ts +0 -5
  114. package/dist/DescriptionList/DescriptionListDescription.test.js +0 -33
  115. package/dist/DescriptionList/DescriptionListSection.test.d.ts +0 -5
  116. package/dist/DescriptionList/DescriptionListSection.test.js +0 -33
  117. package/dist/DescriptionList/DescriptionListTerm.test.d.ts +0 -5
  118. package/dist/DescriptionList/DescriptionListTerm.test.js +0 -33
  119. package/dist/Dialog/Dialog.test.d.ts +0 -5
  120. package/dist/Dialog/Dialog.test.js +0 -82
  121. package/dist/ErrorMessage/ErrorMessage.test.d.ts +0 -5
  122. package/dist/ErrorMessage/ErrorMessage.test.js +0 -53
  123. package/dist/Field/Field.test.d.ts +0 -5
  124. package/dist/Field/Field.test.js +0 -38
  125. package/dist/FieldSet/FieldSet.test.d.ts +0 -5
  126. package/dist/FieldSet/FieldSet.test.js +0 -70
  127. package/dist/Figure/Figure.test.d.ts +0 -5
  128. package/dist/Figure/Figure.test.js +0 -33
  129. package/dist/Figure/FigureCaption.test.d.ts +0 -5
  130. package/dist/Figure/FigureCaption.test.js +0 -38
  131. package/dist/FileInput/FileInput.test.d.ts +0 -5
  132. package/dist/FileInput/FileInput.test.js +0 -33
  133. package/dist/FileList/FileList.test.d.ts +0 -5
  134. package/dist/FileList/FileList.test.js +0 -33
  135. package/dist/FileList/FileListItem.test.d.ts +0 -5
  136. package/dist/FileList/FileListItem.test.js +0 -44
  137. package/dist/Grid/Grid.test.d.ts +0 -5
  138. package/dist/Grid/Grid.test.js +0 -69
  139. package/dist/Grid/GridCell.test.d.ts +0 -5
  140. package/dist/Grid/GridCell.test.js +0 -84
  141. package/dist/Heading/Heading.test.d.ts +0 -5
  142. package/dist/Heading/Heading.test.js +0 -70
  143. package/dist/Hint/Hint.test.d.ts +0 -5
  144. package/dist/Hint/Hint.test.js +0 -53
  145. package/dist/Icon/Icon.test.d.ts +0 -5
  146. package/dist/Icon/Icon.test.js +0 -60
  147. package/dist/IconButton/IconButton.test.d.ts +0 -5
  148. package/dist/IconButton/IconButton.test.js +0 -48
  149. package/dist/Image/Image.test.d.ts +0 -5
  150. package/dist/Image/Image.test.js +0 -43
  151. package/dist/ImageSlider/ImageSlider.test.d.ts +0 -5
  152. package/dist/ImageSlider/ImageSlider.test.js +0 -70
  153. package/dist/ImageSlider/ImageSliderControls.test.d.ts +0 -5
  154. package/dist/ImageSlider/ImageSliderControls.test.js +0 -25
  155. package/dist/ImageSlider/ImageSliderItem.test.d.ts +0 -5
  156. package/dist/ImageSlider/ImageSliderItem.test.js +0 -37
  157. package/dist/ImageSlider/ImageSliderScroller.test.d.ts +0 -5
  158. package/dist/ImageSlider/ImageSliderScroller.test.js +0 -37
  159. package/dist/ImageSlider/ImageSliderThumbnails.test.d.ts +0 -5
  160. package/dist/ImageSlider/ImageSliderThumbnails.test.js +0 -52
  161. package/dist/InvalidFormAlert/InvalidFormAlert.test.d.ts +0 -5
  162. package/dist/InvalidFormAlert/InvalidFormAlert.test.js +0 -108
  163. package/dist/Label/Label.test.d.ts +0 -5
  164. package/dist/Label/Label.test.js +0 -82
  165. package/dist/Link/Link.test.d.ts +0 -5
  166. package/dist/Link/Link.test.js +0 -43
  167. package/dist/LinkList/LinkList.test.d.ts +0 -5
  168. package/dist/LinkList/LinkList.test.js +0 -33
  169. package/dist/LinkList/LinkListLink.test.d.ts +0 -5
  170. package/dist/LinkList/LinkListLink.test.js +0 -54
  171. package/dist/Logo/Logo.test.d.ts +0 -5
  172. package/dist/Logo/Logo.test.js +0 -33
  173. package/dist/Mark/Mark.test.d.ts +0 -5
  174. package/dist/Mark/Mark.test.js +0 -33
  175. package/dist/Menu/Menu.test.d.ts +0 -5
  176. package/dist/Menu/Menu.test.js +0 -55
  177. package/dist/Menu/MenuLink.test.d.ts +0 -5
  178. package/dist/Menu/MenuLink.test.js +0 -56
  179. package/dist/OrderedList/OrderedList.test.d.ts +0 -5
  180. package/dist/OrderedList/OrderedList.test.js +0 -55
  181. package/dist/OrderedList/OrderedListItem.test.d.ts +0 -5
  182. package/dist/OrderedList/OrderedListItem.test.js +0 -32
  183. package/dist/Overlap/Overlap.test.d.ts +0 -5
  184. package/dist/Overlap/Overlap.test.js +0 -38
  185. package/dist/Page/Page.test.d.ts +0 -5
  186. package/dist/Page/Page.test.js +0 -33
  187. package/dist/PageFooter/PageFooter.test.d.ts +0 -5
  188. package/dist/PageFooter/PageFooter.test.js +0 -33
  189. package/dist/PageFooter/PageFooterMenu.test.d.ts +0 -5
  190. package/dist/PageFooter/PageFooterMenu.test.js +0 -35
  191. package/dist/PageFooter/PageFooterMenuLink.test.d.ts +0 -5
  192. package/dist/PageFooter/PageFooterMenuLink.test.js +0 -33
  193. package/dist/PageFooter/PageFooterSpotlight.test.d.ts +0 -5
  194. package/dist/PageFooter/PageFooterSpotlight.test.js +0 -33
  195. package/dist/PageHeader/PageHeader.test.d.ts +0 -6
  196. package/dist/PageHeader/PageHeader.test.js +0 -131
  197. package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.test.d.ts +0 -5
  198. package/dist/PageHeader/PageHeaderGridCellNarrowWindowOnly.test.js +0 -38
  199. package/dist/PageHeader/PageHeaderMenuLink.test.d.ts +0 -5
  200. package/dist/PageHeader/PageHeaderMenuLink.test.js +0 -45
  201. package/dist/PageHeading/PageHeading.test.d.ts +0 -5
  202. package/dist/PageHeading/PageHeading.test.js +0 -40
  203. package/dist/Pagination/Pagination.test.d.ts +0 -5
  204. package/dist/Pagination/Pagination.test.js +0 -137
  205. package/dist/Paragraph/Paragraph.test.d.ts +0 -5
  206. package/dist/Paragraph/Paragraph.test.js +0 -62
  207. package/dist/PasswordInput/PasswordInput.test.d.ts +0 -5
  208. package/dist/PasswordInput/PasswordInput.test.js +0 -89
  209. package/dist/Radio/Radio.test.d.ts +0 -5
  210. package/dist/Radio/Radio.test.js +0 -134
  211. package/dist/Row/Row.test.d.ts +0 -5
  212. package/dist/Row/Row.test.js +0 -64
  213. package/dist/SearchField/SearchField.test.d.ts +0 -5
  214. package/dist/SearchField/SearchField.test.js +0 -33
  215. package/dist/SearchField/SearchFieldButton.test.d.ts +0 -5
  216. package/dist/SearchField/SearchFieldButton.test.js +0 -47
  217. package/dist/SearchField/SearchFieldInput.test.d.ts +0 -5
  218. package/dist/SearchField/SearchFieldInput.test.js +0 -65
  219. package/dist/Select/Select.test.d.ts +0 -5
  220. package/dist/Select/Select.test.js +0 -74
  221. package/dist/Select/SelectOption.test.d.ts +0 -5
  222. package/dist/Select/SelectOption.test.js +0 -45
  223. package/dist/Select/SelectOptionGroup.test.d.ts +0 -5
  224. package/dist/Select/SelectOptionGroup.test.js +0 -45
  225. package/dist/SkipLink/SkipLink.test.d.ts +0 -5
  226. package/dist/SkipLink/SkipLink.test.js +0 -33
  227. package/dist/Spotlight/Spotlight.test.d.ts +0 -5
  228. package/dist/Spotlight/Spotlight.test.js +0 -46
  229. package/dist/StandaloneLink/StandaloneLink.test.d.ts +0 -5
  230. package/dist/StandaloneLink/StandaloneLink.test.js +0 -46
  231. package/dist/Switch/Switch.test.d.ts +0 -5
  232. package/dist/Switch/Switch.test.js +0 -69
  233. package/dist/Table/Table.test.d.ts +0 -5
  234. package/dist/Table/Table.test.js +0 -33
  235. package/dist/Table/TableBody.test.d.ts +0 -5
  236. package/dist/Table/TableBody.test.js +0 -34
  237. package/dist/Table/TableCaption.test.d.ts +0 -5
  238. package/dist/Table/TableCaption.test.js +0 -45
  239. package/dist/Table/TableCell.test.d.ts +0 -5
  240. package/dist/Table/TableCell.test.js +0 -36
  241. package/dist/Table/TableFooter.test.d.ts +0 -5
  242. package/dist/Table/TableFooter.test.js +0 -34
  243. package/dist/Table/TableHeader.test.d.ts +0 -5
  244. package/dist/Table/TableHeader.test.js +0 -34
  245. package/dist/Table/TableHeaderCell.test.d.ts +0 -5
  246. package/dist/Table/TableHeaderCell.test.js +0 -42
  247. package/dist/Table/TableRow.test.d.ts +0 -5
  248. package/dist/Table/TableRow.test.js +0 -35
  249. package/dist/TableOfContents/TableOfContents.test.d.ts +0 -5
  250. package/dist/TableOfContents/TableOfContents.test.js +0 -44
  251. package/dist/TableOfContents/TableOfContentsLink.test.d.ts +0 -5
  252. package/dist/TableOfContents/TableOfContentsLink.test.js +0 -34
  253. package/dist/TableOfContents/TableOfContentsList.test.d.ts +0 -5
  254. package/dist/TableOfContents/TableOfContentsList.test.js +0 -40
  255. package/dist/Tabs/Tabs.test.d.ts +0 -5
  256. package/dist/Tabs/Tabs.test.js +0 -104
  257. package/dist/Tabs/TabsButton.test.d.ts +0 -5
  258. package/dist/Tabs/TabsButton.test.js +0 -57
  259. package/dist/Tabs/TabsList.test.d.ts +0 -5
  260. package/dist/Tabs/TabsList.test.js +0 -32
  261. package/dist/Tabs/TabsPanel.test.d.ts +0 -5
  262. package/dist/Tabs/TabsPanel.test.js +0 -42
  263. package/dist/TextArea/TextArea.test.d.ts +0 -5
  264. package/dist/TextArea/TextArea.test.js +0 -105
  265. package/dist/TextInput/TextInput.test.d.ts +0 -5
  266. package/dist/TextInput/TextInput.test.js +0 -92
  267. package/dist/TimeInput/TimeInput.test.d.ts +0 -5
  268. package/dist/TimeInput/TimeInput.test.js +0 -51
  269. package/dist/UnorderedList/UnorderedList.test.d.ts +0 -5
  270. package/dist/UnorderedList/UnorderedList.test.js +0 -55
  271. package/dist/UnorderedList/UnorderedListItem.test.d.ts +0 -5
  272. package/dist/UnorderedList/UnorderedListItem.test.js +0 -32
  273. package/dist/common/formatFileSize.test.d.ts +0 -5
  274. package/dist/common/formatFileSize.test.js +0 -22
  275. package/dist/common/formatFileType.test.d.ts +0 -5
  276. package/dist/common/formatFileType.test.js +0 -27
  277. package/dist/common/useKeyboardFocus.test.d.ts +0 -5
  278. package/dist/common/useKeyboardFocus.test.js +0 -79
  279. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,84 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
6
- import { render, screen } from '@testing-library/react';
7
- import { createRef } from 'react';
8
- import { ariaRoleForTag } from '../common/accessibility';
9
- import { Grid } from './Grid';
10
- import { gridCellTags } from './GridCell';
11
- import '@testing-library/jest-dom';
12
- describe('Grid cell', () => {
13
- it('renders', () => {
14
- const { container } = render(_jsx(Grid.Cell, {}));
15
- const component = container.querySelector(':only-child');
16
- expect(component).toBeInTheDocument();
17
- expect(component).toBeVisible();
18
- });
19
- it('renders a design system BEM class name', () => {
20
- const { container } = render(_jsx(Grid.Cell, {}));
21
- const component = container.querySelector(':only-child');
22
- expect(component).toHaveClass('ams-grid__cell');
23
- });
24
- it('renders an extra class name', () => {
25
- const { container } = render(_jsx(Grid.Cell, { className: "extra" }));
26
- const component = container.querySelector(':only-child');
27
- expect(component).toHaveClass('ams-grid__cell extra');
28
- });
29
- it('renders no class names for undefined values for start and span', () => {
30
- const { container } = render(_jsx(Grid.Cell, {}));
31
- const elementWithSpanClass = container.querySelector('[class*="ams-grid__cell--span"]');
32
- const elementWithStartClass = container.querySelector('[class*="ams-grid__cell--start"]');
33
- expect(elementWithSpanClass).not.toBeInTheDocument();
34
- expect(elementWithStartClass).not.toBeInTheDocument();
35
- });
36
- it('renders class names for single number values for start and span', () => {
37
- const { container } = render(_jsx(Grid.Cell, { span: 4, start: 2 }));
38
- const component = container.querySelector(':only-child');
39
- expect(component).toHaveClass('ams-grid__cell--span-4 ams-grid__cell--start-2');
40
- });
41
- it('renders class names for a single number value for start', () => {
42
- const { container } = render(_jsx(Grid.Cell, { span: 8 }));
43
- const component = container.querySelector(':only-child');
44
- expect(component).toHaveClass('ams-grid__cell--span-8');
45
- });
46
- it('renders class names for a single number value for span', () => {
47
- const { container } = render(_jsx(Grid.Cell, { start: 6 }));
48
- const component = container.querySelector(':only-child');
49
- expect(component).toHaveClass('ams-grid__cell--start-6');
50
- });
51
- it('renders class names for a single number for span and an object for start', () => {
52
- const { container } = render(_jsx(Grid.Cell, { span: 8, start: { narrow: 2, medium: 4, wide: 6 } }));
53
- const component = container.querySelector(':only-child');
54
- expect(component).toHaveClass('ams-grid__cell--span-8 ams-grid__cell--start-2 ams-grid__cell--start-4-medium ams-grid__cell--start-6-wide');
55
- });
56
- it('renders class names for an object for span and a single number for start', () => {
57
- const { container } = render(_jsx(Grid.Cell, { span: { narrow: 3, medium: 5, wide: 7 }, start: 2 }));
58
- const component = container.querySelector(':only-child');
59
- expect(component).toHaveClass('ams-grid__cell--span-3 ams-grid__cell--span-5-medium ams-grid__cell--span-7-wide ams-grid__cell--start-2');
60
- });
61
- it('renders class names for an object for both start and span', () => {
62
- const { container } = render(_jsx(Grid.Cell, { span: { narrow: 2, medium: 4, wide: 6 }, start: { narrow: 1, medium: 3, wide: 5 } }));
63
- const component = container.querySelector(':only-child');
64
- expect(component).toHaveClass('ams-grid__cell--span-2 ams-grid__cell--span-4-medium ams-grid__cell--span-6-wide ams-grid__cell--start-1 ams-grid__cell--start-3-medium ams-grid__cell--start-5-wide');
65
- });
66
- it('renders the correct class name for the “all” value of span', () => {
67
- const { container } = render(_jsx(Grid.Cell, { span: "all" }));
68
- const component = container.querySelector(':only-child');
69
- expect(component).toHaveClass('ams-grid__cell--span-all');
70
- });
71
- gridCellTags.forEach((tag) => {
72
- it(`renders with a custom ${tag} tag`, () => {
73
- const { container } = render(_jsx(Grid.Cell, { "aria-label": tag === 'section' ? 'Accessible name' : undefined, as: tag }));
74
- const component = tag === 'div' ? container.querySelector(tag) : screen.getByRole(ariaRoleForTag[tag]);
75
- expect(component).toBeInTheDocument();
76
- });
77
- });
78
- it('supports ForwardRef in React', () => {
79
- const ref = createRef();
80
- const { container } = render(_jsx(Grid.Cell, { ref: ref }));
81
- const component = container.querySelector(':only-child');
82
- expect(ref.current).toBe(component);
83
- });
84
- });
@@ -1,5 +0,0 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
- import '@testing-library/jest-dom';
@@ -1,70 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
6
- import { render, screen } from '@testing-library/react';
7
- import { createRef } from 'react';
8
- import { Heading } from './Heading';
9
- import '@testing-library/jest-dom';
10
- describe('Heading', () => {
11
- it('renders an element with role heading', () => {
12
- render(_jsx(Heading, { level: 1, children: "Breaking news" }));
13
- const heading = screen.getByRole('heading', {
14
- name: 'Breaking news',
15
- });
16
- expect(heading).toBeInTheDocument();
17
- expect(heading).toBeVisible();
18
- });
19
- it('renders a design system BEM class name', () => {
20
- render(_jsx(Heading, { level: 1 }));
21
- const heading = screen.getByRole('heading');
22
- expect(heading).toHaveClass('ams-heading');
23
- });
24
- it('renders an extra class name', () => {
25
- render(_jsx(Heading, { className: "extra", level: 1 }));
26
- const heading = screen.getByRole('heading');
27
- expect(heading).toHaveClass('ams-heading extra');
28
- });
29
- it('renders the allowed levels correctly', () => {
30
- render(_jsxs(_Fragment, { children: [_jsx(Heading, { level: 1, children: "Heading 1" }), _jsx(Heading, { level: 2, children: "Heading 2" }), _jsx(Heading, { level: 3, children: "Heading 3" }), _jsx(Heading, { level: 4, children: "Heading 4" })] }));
31
- const h1 = screen.getByRole('heading', { level: 1, name: 'Heading 1' });
32
- const h2 = screen.getByRole('heading', { level: 2, name: 'Heading 2' });
33
- const h3 = screen.getByRole('heading', { level: 3, name: 'Heading 3' });
34
- const h4 = screen.getByRole('heading', { level: 4, name: 'Heading 4' });
35
- expect(h1).toBeInTheDocument();
36
- expect(h2).toBeInTheDocument();
37
- expect(h3).toBeInTheDocument();
38
- expect(h4).toBeInTheDocument();
39
- });
40
- it('renders the correct size level class', () => {
41
- render(_jsxs(_Fragment, { children: [_jsx(Heading, { level: 1, size: "level-1", children: "Size level 1" }), _jsx(Heading, { level: 1, size: "level-2", children: "Size level 2" }), _jsx(Heading, { level: 1, size: "level-3", children: "Size level 3" }), _jsx(Heading, { level: 1, size: "level-4", children: "Size level 4" }), _jsx(Heading, { level: 1, size: "level-5", children: "Size level 5" })] }));
42
- const sizeLevel1 = screen.getByRole('heading', { level: 1, name: 'Size level 1' });
43
- const sizeLevel2 = screen.getByRole('heading', { level: 1, name: 'Size level 2' });
44
- const sizeLevel3 = screen.getByRole('heading', { level: 1, name: 'Size level 3' });
45
- const sizeLevel4 = screen.getByRole('heading', { level: 1, name: 'Size level 4' });
46
- const sizeLevel5 = screen.getByRole('heading', { level: 1, name: 'Size level 5' });
47
- expect(sizeLevel1).toHaveClass('ams-heading--1');
48
- expect(sizeLevel2).toHaveClass('ams-heading--2');
49
- expect(sizeLevel3).toHaveClass('ams-heading--3');
50
- expect(sizeLevel4).toHaveClass('ams-heading--4');
51
- expect(sizeLevel5).toHaveClass('ams-heading--5');
52
- });
53
- it('renders the class name for inverse color', () => {
54
- render(_jsx(Heading, { color: "inverse", level: 1, children: "Heading" }));
55
- const heading = screen.getByRole('heading', { name: 'Heading' });
56
- expect(heading).toHaveClass('ams-heading--inverse');
57
- });
58
- it('renders inline markup', () => {
59
- render(_jsxs(Heading, { level: 1, children: [_jsx("strong", { children: "Breaking" }), " news"] }));
60
- const heading = screen.getByRole('heading', { name: 'Breaking news' });
61
- const inlineMarkup = heading.querySelector('strong');
62
- expect(inlineMarkup).toBeInTheDocument();
63
- });
64
- it('is able to pass a React ref', () => {
65
- const ref = createRef();
66
- render(_jsx(Heading, { level: 1, ref: ref }));
67
- const heading = screen.getByRole('heading');
68
- expect(ref.current).toBe(heading);
69
- });
70
- });
@@ -1,5 +0,0 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
- import '@testing-library/jest-dom';
@@ -1,53 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
6
- import { render } from '@testing-library/react';
7
- import { createRef } from 'react';
8
- import { Hint } from '.';
9
- import '@testing-library/jest-dom';
10
- describe('Hint', () => {
11
- it('renders', () => {
12
- const { container } = render(_jsx(Hint, { hint: "hint" }));
13
- const component = container.querySelector(':only-child');
14
- expect(component).toBeInTheDocument();
15
- expect(component).toBeVisible();
16
- });
17
- it('renders a design system BEM class name', () => {
18
- const { container } = render(_jsx(Hint, { optional: true }));
19
- const component = container.querySelector(':only-child');
20
- expect(component).toHaveClass('ams-hint');
21
- });
22
- it('renders an extra class name', () => {
23
- const { container } = render(_jsx(Hint, { className: "extra", optional: true }));
24
- const component = container.querySelector(':only-child');
25
- expect(component).toHaveClass('ams-hint extra');
26
- });
27
- it('supports ForwardRef in React', () => {
28
- const ref = createRef();
29
- const { container } = render(_jsx(Hint, { ref: ref }));
30
- const component = container.querySelector(':only-child');
31
- expect(ref.current).toBe(component);
32
- });
33
- it('renders the provided hint text', () => {
34
- const { container } = render(_jsx(Hint, { hint: "hint text" }));
35
- const component = container.querySelector(':only-child');
36
- expect(component).toHaveTextContent('(hint text)');
37
- });
38
- it('renders the default hint text', () => {
39
- const { container } = render(_jsx(Hint, { optional: true }));
40
- const component = container.querySelector(':only-child');
41
- expect(component).toHaveTextContent('(niet verplicht)');
42
- });
43
- it('renders the provided hint text when `optional` is set to `false`', () => {
44
- const { container } = render(_jsx(Hint, { hint: "not required", optional: true }));
45
- const component = container.querySelector(':only-child');
46
- expect(component).toHaveTextContent('(not required)');
47
- });
48
- it('renders the provided hint text "required" while also being marked as not optional', () => {
49
- const { container } = render(_jsx(Hint, { hint: "required", optional: false }));
50
- const component = container.querySelector(':only-child');
51
- expect(component).toHaveTextContent('(required)');
52
- });
53
- });
@@ -1,5 +0,0 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
- import '@testing-library/jest-dom';
@@ -1,60 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
6
- import { WarningIcon } from '@amsterdam/design-system-react-icons';
7
- import { render } from '@testing-library/react';
8
- import { createRef } from 'react';
9
- import { Icon, iconSizes } from './Icon';
10
- import '@testing-library/jest-dom';
11
- describe('Icon', () => {
12
- it('renders a span element', () => {
13
- const { container } = render(_jsx(Icon, { svg: WarningIcon }));
14
- const icon = container.querySelector('span:only-child');
15
- expect(icon).toBeInTheDocument();
16
- });
17
- it('renders with a React node for the svg prop', () => {
18
- const { container } = render(_jsx(Icon, { svg: _jsx(WarningIcon, {}) }));
19
- const icon = container.querySelector('span:only-child');
20
- expect(icon).toBeInTheDocument();
21
- });
22
- it('renders a design system BEM class name', () => {
23
- const { container } = render(_jsx(Icon, { svg: WarningIcon }));
24
- const icon = container.querySelector(':only-child');
25
- expect(icon).toHaveClass('ams-icon');
26
- });
27
- it('renders an svg child', () => {
28
- const { container } = render(_jsx(Icon, { svg: WarningIcon }));
29
- const svg = container.querySelector(':only-child svg');
30
- expect(svg).toBeInTheDocument();
31
- });
32
- iconSizes.forEach((size) => {
33
- it(`renders the correct class name for a ‘${size}’ icon`, () => {
34
- const { container } = render(_jsx(Icon, { size: size, svg: WarningIcon }));
35
- const icon = container.querySelector(':only-child');
36
- expect(icon).toHaveClass(`ams-icon--${size}`);
37
- });
38
- });
39
- it('renders the right square class', () => {
40
- const { container } = render(_jsx(Icon, { square: true, svg: WarningIcon }));
41
- const icon = container.querySelector('span:only-child');
42
- expect(icon).toHaveClass('ams-icon--square');
43
- });
44
- it('renders the class name for inverse color', () => {
45
- const { container } = render(_jsx(Icon, { color: "inverse", svg: WarningIcon }));
46
- const icon = container.querySelector('span:only-child');
47
- expect(icon).toHaveClass('ams-icon--inverse');
48
- });
49
- it('renders an extra class name', () => {
50
- const { container } = render(_jsx(Icon, { className: "extra", svg: WarningIcon }));
51
- const icon = container.querySelector(':only-child');
52
- expect(icon).toHaveClass('ams-icon extra');
53
- });
54
- it('supports ForwardRef in React', () => {
55
- const ref = createRef();
56
- const { container } = render(_jsx(Icon, { ref: ref, svg: WarningIcon }));
57
- const icon = container.querySelector(':only-child');
58
- expect(ref.current).toBe(icon);
59
- });
60
- });
@@ -1,5 +0,0 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
- import '@testing-library/jest-dom';
@@ -1,48 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
6
- import { render, screen } from '@testing-library/react';
7
- import { createRef } from 'react';
8
- import { IconButton } from './IconButton';
9
- import '@testing-library/jest-dom';
10
- describe('Icon button', () => {
11
- it('renders', () => {
12
- render(_jsx(IconButton, { label: "Test" }));
13
- const component = screen.getByRole('button');
14
- expect(component).toBeInTheDocument();
15
- expect(component).toBeVisible();
16
- });
17
- it('renders a design system BEM class name', () => {
18
- render(_jsx(IconButton, { label: "Test" }));
19
- const component = screen.getByRole('button');
20
- expect(component).toHaveClass('ams-icon-button');
21
- });
22
- it('renders an extra class name', () => {
23
- render(_jsx(IconButton, { className: "extra", label: "Test" }));
24
- const component = screen.getByRole('button');
25
- expect(component).toHaveClass('ams-icon-button extra');
26
- });
27
- it('renders an accessible label', () => {
28
- render(_jsx(IconButton, { className: "extra", label: "Test" }));
29
- const component = screen.getByRole('button', { name: 'Test' });
30
- expect(component).toBeInTheDocument();
31
- });
32
- it('renders the class name for contrast color', () => {
33
- render(_jsx(IconButton, { color: "contrast", label: "Test" }));
34
- const component = screen.getByRole('button');
35
- expect(component).toHaveClass('ams-icon-button--contrast');
36
- });
37
- it('renders the class name for inverse color', () => {
38
- render(_jsx(IconButton, { color: "inverse", label: "Test" }));
39
- const component = screen.getByRole('button');
40
- expect(component).toHaveClass('ams-icon-button--inverse');
41
- });
42
- it('supports ForwardRef in React', () => {
43
- const ref = createRef();
44
- render(_jsx(IconButton, { label: "Test", ref: ref }));
45
- const component = screen.getByRole('button');
46
- expect(ref.current).toBe(component);
47
- });
48
- });
@@ -1,5 +0,0 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
- import '@testing-library/jest-dom';
@@ -1,43 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
6
- import { render } from '@testing-library/react';
7
- import { createRef } from 'react';
8
- import { aspectRatioOptions } from '../common/types';
9
- import { generateAspectRatioClass } from './generateAspectRatioClass';
10
- import { Image } from './Image';
11
- import '@testing-library/jest-dom';
12
- describe('Image', () => {
13
- it('renders', () => {
14
- const { container } = render(_jsx(Image, { alt: "" }));
15
- const component = container.querySelector(':only-child');
16
- expect(component).toBeInTheDocument();
17
- expect(component).toBeVisible();
18
- });
19
- it('renders a design system BEM class name', () => {
20
- const { container } = render(_jsx(Image, { alt: "" }));
21
- const component = container.querySelector(':only-child');
22
- expect(component).toHaveClass('ams-image');
23
- });
24
- it('renders an extra class name', () => {
25
- const { container } = render(_jsx(Image, { alt: "", className: "extra" }));
26
- const component = container.querySelector(':only-child');
27
- expect(component).toHaveClass('ams-image extra');
28
- });
29
- aspectRatioOptions.forEach((aspectRatio) => {
30
- it(`renders class names to display the image in the ${aspectRatio} aspect ratio`, () => {
31
- const { container } = render(_jsx(Image, { alt: "", aspectRatio: aspectRatio }));
32
- const component = container.querySelector(':only-child');
33
- const aspectRatioClass = generateAspectRatioClass(aspectRatio) || '';
34
- expect(component).toHaveClass(aspectRatioClass);
35
- });
36
- });
37
- it('supports ForwardRef in React', () => {
38
- const ref = createRef();
39
- const { container } = render(_jsx(Image, { alt: "", ref: ref }));
40
- const component = container.querySelector(':only-child');
41
- expect(ref.current).toBe(component);
42
- });
43
- });
@@ -1,5 +0,0 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
- import '@testing-library/jest-dom';
@@ -1,70 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
6
- import { render } from '@testing-library/react';
7
- import { createRef } from 'react';
8
- import { ImageSlider } from './ImageSlider';
9
- import '@testing-library/jest-dom';
10
- const observe = jest.fn();
11
- const unobserve = jest.fn();
12
- const disconnect = jest.fn();
13
- const takeRecords = jest.fn();
14
- // Mock implementation of IntersectionObserver
15
- window.IntersectionObserver = jest.fn(() => ({
16
- disconnect,
17
- observe,
18
- root: null,
19
- rootMargin: '',
20
- takeRecords,
21
- thresholds: [],
22
- unobserve,
23
- }));
24
- describe('Image Slider', () => {
25
- const images = [
26
- {
27
- alt: 'Bridge',
28
- src: 'https://picsum.photos/id/122/320/180',
29
- },
30
- {
31
- alt: 'Bunker',
32
- src: 'https://picsum.photos/id/101/320/180',
33
- },
34
- {
35
- alt: 'Chairs',
36
- src: 'https://picsum.photos/id/153/320/180',
37
- },
38
- ];
39
- it('renders', () => {
40
- const { container } = render(_jsx(ImageSlider, { images: images }));
41
- const component = container.querySelector(':only-child');
42
- expect(component).toBeInTheDocument();
43
- expect(component).toBeVisible();
44
- });
45
- it('renders slides', () => {
46
- const { container } = render(_jsx(ImageSlider, { images: images }));
47
- const slides = Array.from(container.querySelectorAll('.ams-image-slider__item'));
48
- expect(slides).toHaveLength(3);
49
- });
50
- it('renders a design system BEM class name', () => {
51
- const { container } = render(_jsx(ImageSlider, { images: images }));
52
- const component = container.querySelector(':only-child');
53
- expect(component).toHaveClass('ams-image-slider');
54
- });
55
- it('renders an extra class name', () => {
56
- const { container } = render(_jsx(ImageSlider, { className: "extra", images: images }));
57
- const component = container.querySelector(':only-child');
58
- expect(component).toHaveClass('ams-image-slider extra');
59
- });
60
- it('supports ForwardRef in React', () => {
61
- const ref = createRef();
62
- const { container } = render(_jsx(ImageSlider, { images: images, ref: ref }));
63
- const component = container.querySelector(':only-child');
64
- expect(ref.current).toBe(component);
65
- });
66
- it('renders thumbnails', () => {
67
- const { container } = render(_jsx(ImageSlider, { images: images }));
68
- expect(container.querySelector('.ams-image-slider__thumbnails')).toBeInTheDocument();
69
- });
70
- });
@@ -1,5 +0,0 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
- import '@testing-library/jest-dom';
@@ -1,25 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
6
- import { render } from '@testing-library/react';
7
- import { createRef } from 'react';
8
- import { ImageSliderControls } from './ImageSliderControls';
9
- import '@testing-library/jest-dom';
10
- describe('Image Slider Controls', () => {
11
- const nextLabel = 'Volgende';
12
- const previousLabel = 'Vorige';
13
- it('renders', () => {
14
- const { container } = render(_jsx(ImageSliderControls, { nextLabel: nextLabel, previousLabel: previousLabel }));
15
- const component = container.querySelector(':only-child');
16
- expect(component).toBeInTheDocument();
17
- expect(component).toBeVisible();
18
- });
19
- it('supports ForwardRef in React', () => {
20
- const ref = createRef();
21
- const { container } = render(_jsx(ImageSliderControls, { nextLabel: nextLabel, previousLabel: previousLabel, ref: ref }));
22
- const component = container.querySelector(':only-child');
23
- expect(ref.current).toBe(component);
24
- });
25
- });
@@ -1,5 +0,0 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
- import '@testing-library/jest-dom';
@@ -1,37 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
6
- import { render } from '@testing-library/react';
7
- import { createRef } from 'react';
8
- import { ImageSliderItem } from './ImageSliderItem';
9
- import '@testing-library/jest-dom';
10
- describe('Image Slider Item', () => {
11
- it('renders', () => {
12
- const { container } = render(_jsx(ImageSliderItem, { slideId: 0 }));
13
- const component = container.querySelector(':only-child');
14
- expect(component).toBeInTheDocument();
15
- expect(component).toBeVisible();
16
- });
17
- it('renders children', () => {
18
- const { container } = render(_jsx(ImageSliderItem, { slideId: 0, children: "child" }));
19
- expect(container).toHaveTextContent('child');
20
- });
21
- it('renders a design system BEM class name', () => {
22
- const { container } = render(_jsx(ImageSliderItem, { slideId: 0 }));
23
- const component = container.querySelector(':only-child');
24
- expect(component).toHaveClass('ams-image-slider__item');
25
- });
26
- it('renders an extra class name', () => {
27
- const { container } = render(_jsx(ImageSliderItem, { className: "extra", slideId: 0 }));
28
- const component = container.querySelector(':only-child');
29
- expect(component).toHaveClass('ams-image-slider__item extra');
30
- });
31
- it('supports ForwardRef in React', () => {
32
- const ref = createRef();
33
- const { container } = render(_jsx(ImageSliderItem, { ref: ref, slideId: 0 }));
34
- const component = container.querySelector(':only-child');
35
- expect(ref.current).toBe(component);
36
- });
37
- });
@@ -1,5 +0,0 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
- import '@testing-library/jest-dom';
@@ -1,37 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
6
- import { render } from '@testing-library/react';
7
- import { createRef } from 'react';
8
- import { ImageSliderScroller } from './ImageSliderScroller';
9
- import '@testing-library/jest-dom';
10
- describe('Image Slider Scroller', () => {
11
- it('renders', () => {
12
- const { container } = render(_jsx(ImageSliderScroller, {}));
13
- const component = container.querySelector(':only-child');
14
- expect(component).toBeInTheDocument();
15
- expect(component).toBeVisible();
16
- });
17
- it('renders children', () => {
18
- const { container } = render(_jsx(ImageSliderScroller, { children: "child" }));
19
- expect(container).toHaveTextContent('child');
20
- });
21
- it('renders a design system BEM class name', () => {
22
- const { container } = render(_jsx(ImageSliderScroller, {}));
23
- const component = container.querySelector(':only-child');
24
- expect(component).toHaveClass('ams-image-slider__scroller');
25
- });
26
- it('renders an extra class name', () => {
27
- const { container } = render(_jsx(ImageSliderScroller, { className: "extra" }));
28
- const component = container.querySelector(':only-child');
29
- expect(component).toHaveClass('ams-image-slider__scroller extra');
30
- });
31
- it('supports ForwardRef in React', () => {
32
- const ref = createRef();
33
- const { container } = render(_jsx(ImageSliderScroller, { ref: ref }));
34
- const component = container.querySelector(':only-child');
35
- expect(ref.current).toBe(component);
36
- });
37
- });
@@ -1,5 +0,0 @@
1
- /**
2
- * @license EUPL-1.2+
3
- * Copyright Gemeente Amsterdam
4
- */
5
- import '@testing-library/jest-dom';
@@ -1,52 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @license EUPL-1.2+
4
- * Copyright Gemeente Amsterdam
5
- */
6
- import { render } from '@testing-library/react';
7
- import { createRef } from 'react';
8
- import { ImageSliderThumbnails } from './ImageSliderThumbnails';
9
- import '@testing-library/jest-dom';
10
- describe('Image Slider Thumbnails', () => {
11
- const thumbnails = [
12
- {
13
- alt: 'This is gallery image 1',
14
- src: 'https://picsum.photos/id/122/1280/720',
15
- },
16
- {
17
- alt: 'This is gallery image 2',
18
- src: 'https://picsum.photos/id/101/1280/720',
19
- },
20
- {
21
- alt: 'This is gallery image 3',
22
- src: 'https://picsum.photos/id/153/1280/720',
23
- },
24
- ];
25
- it('renders', () => {
26
- const { container } = render(_jsx(ImageSliderThumbnails, { thumbnails: thumbnails }));
27
- const component = container.querySelector(':only-child');
28
- expect(component).toBeInTheDocument();
29
- expect(component).toBeVisible();
30
- });
31
- it('renders thumbnails', () => {
32
- const { container } = render(_jsx(ImageSliderThumbnails, { thumbnails: thumbnails }));
33
- const thumbs = container.querySelectorAll('.ams-image-slider__thumbnail');
34
- expect(thumbs).toHaveLength(thumbnails.length);
35
- });
36
- it('renders a design system BEM class name', () => {
37
- const { container } = render(_jsx(ImageSliderThumbnails, { thumbnails: thumbnails }));
38
- const component = container.querySelector(':only-child');
39
- expect(component).toHaveClass('ams-image-slider__thumbnails');
40
- });
41
- it('renders an extra class name', () => {
42
- const { container } = render(_jsx(ImageSliderThumbnails, { className: "extra", thumbnails: thumbnails }));
43
- const component = container.querySelector(':only-child');
44
- expect(component).toHaveClass('ams-image-slider__thumbnails extra');
45
- });
46
- it('supports ForwardRef in React', () => {
47
- const ref = createRef();
48
- const { container } = render(_jsx(ImageSliderThumbnails, { ref: ref, thumbnails: thumbnails }));
49
- const component = container.querySelector(':only-child');
50
- expect(ref.current).toBe(component);
51
- });
52
- });