@nypl/design-system-react-components 1.0.0 → 1.0.3-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -5
- package/dist/components/Checkbox/Checkbox.d.ts +0 -1
- package/dist/components/ComponentWrapper/ComponentWrapper.d.ts +8 -0
- package/dist/components/Heading/Heading.d.ts +2 -0
- package/dist/components/Logo/Logo.d.ts +1 -1
- package/dist/components/Logo/LogoSvgs.d.ts +4 -0
- package/dist/components/Slider/Slider.d.ts +1 -2
- package/dist/components/TextInput/TextInput.d.ts +2 -1
- package/dist/design-system-react-components.cjs.development.js +1038 -674
- package/dist/design-system-react-components.cjs.development.js.map +1 -1
- package/dist/design-system-react-components.cjs.production.min.js +1 -1
- package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
- package/dist/design-system-react-components.esm.js +1039 -675
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/hooks/{tests → __tests__}/useCarouselStyles.test.d.ts +0 -0
- package/dist/theme/components/button.d.ts +1 -0
- package/dist/theme/components/card.d.ts +98 -13
- package/dist/theme/components/checkboxGroup.d.ts +1 -1
- package/dist/theme/components/global.d.ts +2 -2
- package/dist/theme/components/heading.d.ts +4 -16
- package/dist/theme/components/image.d.ts +6 -0
- package/dist/theme/components/radio.d.ts +8 -0
- package/dist/theme/components/radioGroup.d.ts +1 -1
- package/dist/theme/components/skipNavigation.d.ts +3 -0
- package/dist/theme/components/structuredContent.d.ts +0 -5
- package/dist/theme/components/template.d.ts +4 -1
- package/dist/utils/utils.d.ts +15 -0
- package/package.json +6 -7
- package/CHANGELOG.md +0 -1399
- package/src/__tests__/fileMock.ts +0 -6
- package/src/__tests__/setup.ts +0 -27
- package/src/__tests__/utils/utils.test.ts +0 -18
- package/src/components/AccessibilityGuide/SkipNavigation.stories.mdx +0 -42
- package/src/components/Accordion/Accordion.stories.mdx +0 -361
- package/src/components/Accordion/Accordion.test.tsx +0 -237
- package/src/components/Accordion/Accordion.tsx +0 -136
- package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +0 -734
- package/src/components/Autosuggest/Autosuggest.stories.mdx +0 -75
- package/src/components/Autosuggest/Autosuggest.stories.tsx +0 -211
- package/src/components/Autosuggest/_Autosuggest.scss +0 -51
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +0 -231
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +0 -144
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +0 -98
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +0 -695
- package/src/components/Button/Button.stories.mdx +0 -320
- package/src/components/Button/Button.test.tsx +0 -184
- package/src/components/Button/Button.tsx +0 -95
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +0 -106
- package/src/components/ButtonGroup/ButtonGroup.stories.mdx +0 -147
- package/src/components/ButtonGroup/ButtonGroup.test.tsx +0 -141
- package/src/components/ButtonGroup/ButtonGroup.tsx +0 -99
- package/src/components/ButtonGroup/__snapshots__/ButtonGroup.test.tsx.snap +0 -117
- package/src/components/Card/Card.stories.mdx +0 -1043
- package/src/components/Card/Card.test.tsx +0 -388
- package/src/components/Card/Card.tsx +0 -345
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +0 -568
- package/src/components/Chakra/Box.stories.mdx +0 -52
- package/src/components/Chakra/Center.stories.mdx +0 -96
- package/src/components/Chakra/Flex.stories.mdx +0 -111
- package/src/components/Chakra/Grid.stories.mdx +0 -89
- package/src/components/Chakra/Stack.stories.mdx +0 -109
- package/src/components/Checkbox/Checkbox.stories.mdx +0 -243
- package/src/components/Checkbox/Checkbox.test.tsx +0 -319
- package/src/components/Checkbox/Checkbox.tsx +0 -166
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +0 -616
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +0 -462
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +0 -492
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +0 -173
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +0 -1722
- package/src/components/ComponentWrapper/ComponentWrapper.test.tsx +0 -163
- package/src/components/ComponentWrapper/ComponentWrapper.tsx +0 -67
- package/src/components/ComponentWrapper/__snapshots__/ComponentWrapper.test.tsx.snap +0 -98
- package/src/components/DatePicker/DatePicker.stories.mdx +0 -452
- package/src/components/DatePicker/DatePicker.test.tsx +0 -940
- package/src/components/DatePicker/DatePicker.tsx +0 -450
- package/src/components/DatePicker/_DatePicker.scss +0 -100
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +0 -889
- package/src/components/Fieldset/Fieldset.stories.mdx +0 -96
- package/src/components/Fieldset/Fieldset.test.tsx +0 -155
- package/src/components/Fieldset/Fieldset.tsx +0 -55
- package/src/components/Fieldset/__snapshots__/Fieldset.test.tsx.snap +0 -89
- package/src/components/Form/Form.stories.mdx +0 -426
- package/src/components/Form/Form.test.tsx +0 -234
- package/src/components/Form/Form.tsx +0 -124
- package/src/components/Form/__snapshots__/Form.test.tsx.snap +0 -115
- package/src/components/Grid/SimpleGrid.stories.mdx +0 -338
- package/src/components/Grid/SimpleGrid.test.tsx +0 -79
- package/src/components/Grid/SimpleGrid.tsx +0 -49
- package/src/components/Grid/__snapshots__/SimpleGrid.test.tsx.snap +0 -23
- package/src/components/Heading/Heading.stories.mdx +0 -184
- package/src/components/Heading/Heading.test.tsx +0 -171
- package/src/components/Heading/Heading.tsx +0 -101
- package/src/components/Heading/__snapshots__/Heading.test.tsx.snap +0 -90
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +0 -172
- package/src/components/HelperErrorText/HelperErrorText.test.tsx +0 -114
- package/src/components/HelperErrorText/HelperErrorText.tsx +0 -62
- package/src/components/HelperErrorText/__snapshots__/HelperErrorText.test.tsx.snap +0 -93
- package/src/components/Hero/Hero.stories.mdx +0 -378
- package/src/components/Hero/Hero.test.tsx +0 -611
- package/src/components/Hero/Hero.tsx +0 -203
- package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +0 -379
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +0 -73
- package/src/components/HorizontalRule/HorizontalRule.test.tsx +0 -54
- package/src/components/HorizontalRule/HorizontalRule.tsx +0 -27
- package/src/components/HorizontalRule/__snapshots__/HorizontalRule.test.tsx.snap +0 -44
- package/src/components/Icons/Icon.stories.mdx +0 -413
- package/src/components/Icons/Icon.test.tsx +0 -120
- package/src/components/Icons/Icon.tsx +0 -187
- package/src/components/Icons/IconSvgs.tsx +0 -64
- package/src/components/Icons/__snapshots__/Icon.test.tsx.snap +0 -129
- package/src/components/Image/Image.stories.mdx +0 -332
- package/src/components/Image/Image.test.tsx +0 -155
- package/src/components/Image/Image.tsx +0 -171
- package/src/components/Image/__snapshots__/Image.test.tsx.snap +0 -269
- package/src/components/Label/Label.stories.mdx +0 -100
- package/src/components/Label/Label.test.tsx +0 -116
- package/src/components/Label/Label.tsx +0 -55
- package/src/components/Label/__snapshots__/Label.test.tsx.snap +0 -45
- package/src/components/Link/Link.stories.mdx +0 -249
- package/src/components/Link/Link.test.tsx +0 -224
- package/src/components/Link/Link.tsx +0 -178
- package/src/components/Link/__snapshots__/Link.test.tsx.snap +0 -286
- package/src/components/List/List.stories.mdx +0 -393
- package/src/components/List/List.test.tsx +0 -265
- package/src/components/List/List.tsx +0 -156
- package/src/components/List/__snapshots__/List.test.tsx.snap +0 -213
- package/src/components/Logo/Logo.stories.mdx +0 -290
- package/src/components/Logo/Logo.test.tsx +0 -116
- package/src/components/Logo/Logo.tsx +0 -147
- package/src/components/Logo/LogoSvgs.tsx +0 -82
- package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +0 -142
- package/src/components/Modal/Modal.stories.mdx +0 -301
- package/src/components/Modal/Modal.test.tsx +0 -157
- package/src/components/Modal/Modal.tsx +0 -154
- package/src/components/Modal/__snapshots__/Modal.test.tsx.snap +0 -25
- package/src/components/Notification/Notification.stories.mdx +0 -358
- package/src/components/Notification/Notification.test.tsx +0 -279
- package/src/components/Notification/Notification.tsx +0 -224
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +0 -525
- package/src/components/Pagination/Pagination.stories.mdx +0 -184
- package/src/components/Pagination/Pagination.test.tsx +0 -419
- package/src/components/Pagination/Pagination.tsx +0 -269
- package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +0 -544
- package/src/components/Placeholder/Placeholder.tsx +0 -19
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +0 -360
- package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +0 -298
- package/src/components/ProgressIndicator/ProgressIndicator.tsx +0 -132
- package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +0 -434
- package/src/components/Radio/Radio.stories.mdx +0 -216
- package/src/components/Radio/Radio.test.tsx +0 -247
- package/src/components/Radio/Radio.tsx +0 -128
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +0 -411
- package/src/components/RadioGroup/RadioGroup.stories.mdx +0 -478
- package/src/components/RadioGroup/RadioGroup.test.tsx +0 -471
- package/src/components/RadioGroup/RadioGroup.tsx +0 -170
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +0 -1430
- package/src/components/SearchBar/SearchBar.stories.mdx +0 -518
- package/src/components/SearchBar/SearchBar.test.tsx +0 -435
- package/src/components/SearchBar/SearchBar.tsx +0 -210
- package/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap +0 -1027
- package/src/components/Select/Select.stories.mdx +0 -439
- package/src/components/Select/Select.test.tsx +0 -358
- package/src/components/Select/Select.tsx +0 -181
- package/src/components/Select/__snapshots__/Select.test.tsx.snap +0 -885
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +0 -142
- package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +0 -116
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +0 -123
- package/src/components/SkeletonLoader/__snapshots__/SkeletonLoader.test.tsx.snap +0 -898
- package/src/components/SkipNavigation/SkipNavigation.stories.mdx +0 -90
- package/src/components/SkipNavigation/SkipNavigation.test.tsx +0 -63
- package/src/components/SkipNavigation/SkipNavigation.tsx +0 -51
- package/src/components/SkipNavigation/__snapshots__/SkipNavigation.test.tsx.snap +0 -130
- package/src/components/Slider/Slider.stories.mdx +0 -628
- package/src/components/Slider/Slider.test.tsx +0 -736
- package/src/components/Slider/Slider.tsx +0 -322
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +0 -2153
- package/src/components/StatusBadge/StatusBadge.stories.mdx +0 -109
- package/src/components/StatusBadge/StatusBadge.test.tsx +0 -70
- package/src/components/StatusBadge/StatusBadge.tsx +0 -35
- package/src/components/StatusBadge/__snapshots__/StatusBadge.test.tsx.snap +0 -47
- package/src/components/StructuredContent/StructuredContent.stories.mdx +0 -567
- package/src/components/StructuredContent/StructuredContent.test.tsx +0 -435
- package/src/components/StructuredContent/StructuredContent.tsx +0 -139
- package/src/components/StructuredContent/__snapshots__/StructuredContent.test.tsx.snap +0 -368
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +0 -206
- package/src/components/StyleGuide/Breakpoints.stories.mdx +0 -55
- package/src/components/StyleGuide/Buttons.stories.mdx +0 -194
- package/src/components/StyleGuide/ColorCard.tsx +0 -43
- package/src/components/StyleGuide/Colors.stories.mdx +0 -201
- package/src/components/StyleGuide/DesignTokens.stories.mdx +0 -193
- package/src/components/StyleGuide/Forms.stories.mdx +0 -94
- package/src/components/StyleGuide/Iconography.stories.mdx +0 -142
- package/src/components/StyleGuide/Spacing.stories.mdx +0 -116
- package/src/components/StyleGuide/Typography.stories.mdx +0 -419
- package/src/components/Table/Table.stories.mdx +0 -276
- package/src/components/Table/Table.test.tsx +0 -208
- package/src/components/Table/Table.tsx +0 -131
- package/src/components/Table/__snapshots__/Table.test.tsx.snap +0 -1703
- package/src/components/Tabs/Tabs.stories.mdx +0 -338
- package/src/components/Tabs/Tabs.test.tsx +0 -298
- package/src/components/Tabs/Tabs.tsx +0 -264
- package/src/components/Tabs/__snapshots__/Tabs.test.tsx.snap +0 -584
- package/src/components/Template/Template.stories.mdx +0 -691
- package/src/components/Template/Template.test.tsx +0 -309
- package/src/components/Template/Template.tsx +0 -326
- package/src/components/Template/__snapshots__/Template.test.tsx.snap +0 -342
- package/src/components/Text/Text.stories.mdx +0 -103
- package/src/components/Text/Text.test.tsx +0 -63
- package/src/components/Text/Text.tsx +0 -50
- package/src/components/Text/__snapshots__/Text.test.tsx.snap +0 -50
- package/src/components/TextInput/TextInput.stories.mdx +0 -268
- package/src/components/TextInput/TextInput.test.tsx +0 -451
- package/src/components/TextInput/TextInput.tsx +0 -240
- package/src/components/TextInput/__snapshots__/TextInput.test.tsx.snap +0 -264
- package/src/components/Toggle/Toggle.stories.mdx +0 -237
- package/src/components/Toggle/Toggle.test.tsx +0 -170
- package/src/components/Toggle/Toggle.tsx +0 -126
- package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +0 -442
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +0 -211
- package/src/components/VideoPlayer/VideoPlayer.test.tsx +0 -308
- package/src/components/VideoPlayer/VideoPlayer.tsx +0 -188
- package/src/components/VideoPlayer/__snapshots__/VideoPlayer.test.tsx.snap +0 -187
- package/src/docs/Chakra.stories.mdx +0 -563
- package/src/docs/Welcome.stories.mdx +0 -148
- package/src/helpers/types.ts +0 -1
- package/src/hooks/tests/useCarouselStyles.test.ts +0 -140
- package/src/hooks/tests/useNYPLTheme.test.tsx +0 -36
- package/src/hooks/useCarouselStyles.stories.mdx +0 -30
- package/src/hooks/useCarouselStyles.ts +0 -35
- package/src/hooks/useNYPLTheme.stories.mdx +0 -98
- package/src/hooks/useNYPLTheme.ts +0 -91
- package/src/hooks/useWindowSize.stories.mdx +0 -23
- package/src/hooks/useWindowSize.ts +0 -40
- package/src/index.ts +0 -136
- package/src/resources.scss +0 -6
- package/src/styles/base/_01-breakpoints.scss +0 -27
- package/src/styles/base/_02-mixins.scss +0 -103
- package/src/styles/base/_place-holder.scss +0 -33
- package/src/styles/space/_space-inline.scss +0 -79
- package/src/styles/space/_space-inset.scss +0 -57
- package/src/styles/space/_space-stack.scss +0 -116
- package/src/styles.scss +0 -23
- package/src/theme/components/accordion.ts +0 -25
- package/src/theme/components/breadcrumb.ts +0 -94
- package/src/theme/components/button.ts +0 -132
- package/src/theme/components/buttonGroup.ts +0 -10
- package/src/theme/components/card.ts +0 -231
- package/src/theme/components/checkbox.ts +0 -110
- package/src/theme/components/checkboxGroup.ts +0 -10
- package/src/theme/components/componentWrapper.ts +0 -14
- package/src/theme/components/customTable.ts +0 -77
- package/src/theme/components/datePicker.ts +0 -17
- package/src/theme/components/fieldset.ts +0 -23
- package/src/theme/components/global.ts +0 -91
- package/src/theme/components/globalMixins.ts +0 -24
- package/src/theme/components/heading.ts +0 -79
- package/src/theme/components/helperErrorText.ts +0 -14
- package/src/theme/components/hero.ts +0 -238
- package/src/theme/components/horizontalRule.ts +0 -17
- package/src/theme/components/icon.ts +0 -88
- package/src/theme/components/image.ts +0 -135
- package/src/theme/components/label.ts +0 -15
- package/src/theme/components/link.ts +0 -63
- package/src/theme/components/list.ts +0 -88
- package/src/theme/components/logo.ts +0 -58
- package/src/theme/components/notification.ts +0 -132
- package/src/theme/components/pagination.ts +0 -17
- package/src/theme/components/progressIndicator.ts +0 -67
- package/src/theme/components/radio.ts +0 -103
- package/src/theme/components/radioGroup.ts +0 -10
- package/src/theme/components/searchBar.ts +0 -19
- package/src/theme/components/select.ts +0 -72
- package/src/theme/components/skeletonLoader.ts +0 -113
- package/src/theme/components/skipNavigation.ts +0 -26
- package/src/theme/components/slider.ts +0 -95
- package/src/theme/components/statusBadge.ts +0 -26
- package/src/theme/components/structuredContent.ts +0 -149
- package/src/theme/components/tabs.ts +0 -109
- package/src/theme/components/template.ts +0 -114
- package/src/theme/components/text.ts +0 -38
- package/src/theme/components/textInput.ts +0 -65
- package/src/theme/components/toggle.ts +0 -109
- package/src/theme/components/videoPlayer.ts +0 -47
- package/src/theme/foundations/breakpoints.ts +0 -24
- package/src/theme/foundations/colors.ts +0 -212
- package/src/theme/foundations/global.ts +0 -43
- package/src/theme/foundations/radii.ts +0 -7
- package/src/theme/foundations/shadows.ts +0 -5
- package/src/theme/foundations/spacing.ts +0 -136
- package/src/theme/foundations/typography.ts +0 -107
- package/src/theme/index.ts +0 -131
- package/src/theme/provider.tsx +0 -9
- package/src/theme/types.ts +0 -1
- package/src/utils/componentCategories.ts +0 -152
- package/src/utils/interfaces.ts +0 -5
- package/src/utils/utils.ts +0 -44
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { render, RenderResult, screen } from "@testing-library/react";
|
|
3
|
-
import { axe } from "jest-axe";
|
|
4
|
-
import renderer from "react-test-renderer";
|
|
5
|
-
|
|
6
|
-
import VideoPlayer from "./VideoPlayer";
|
|
7
|
-
|
|
8
|
-
describe("VideoPlayer Accessibility", () => {
|
|
9
|
-
it("passes axe accessibility test", async () => {
|
|
10
|
-
const { container } = render(
|
|
11
|
-
<VideoPlayer videoType="youtube" videoId="nm-dD2tx6bk" />
|
|
12
|
-
);
|
|
13
|
-
expect(await axe(container)).toHaveNoViolations();
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
describe("VideoPlayer", () => {
|
|
18
|
-
const videoId = "nm-dD2tx6bk";
|
|
19
|
-
let utils: RenderResult;
|
|
20
|
-
|
|
21
|
-
describe("YouTube player", () => {
|
|
22
|
-
beforeEach(() => {
|
|
23
|
-
utils = render(<VideoPlayer videoType="youtube" videoId={videoId} />);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it("Renders VideoPlayer container", () => {
|
|
27
|
-
expect(screen.getByTestId("video-player-component")).toBeInTheDocument();
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it("Renders VideoPlayer iframe", () => {
|
|
31
|
-
expect(screen.getByTitle("YouTube video player")).toBeInTheDocument();
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("Renders YouTube video", () => {
|
|
35
|
-
expect(screen.getByTitle("YouTube video player")).toHaveAttribute(
|
|
36
|
-
"src",
|
|
37
|
-
`https://www.youtube.com/embed/${videoId}?disablekb=1&autoplay=0&fs=1&modestbranding=0`
|
|
38
|
-
);
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe("Vimeo player", () => {
|
|
43
|
-
const videoId = "474719268";
|
|
44
|
-
|
|
45
|
-
beforeEach(() => {
|
|
46
|
-
utils = render(<VideoPlayer videoType="vimeo" videoId={videoId} />);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it("Renders VideoPlayer iframe", () => {
|
|
50
|
-
expect(screen.getByTitle("Vimeo video player")).toBeInTheDocument();
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it("Renders Vimeo video", () => {
|
|
54
|
-
expect(screen.getByTitle("Vimeo video player")).toHaveAttribute(
|
|
55
|
-
"src",
|
|
56
|
-
`https://player.vimeo.com/video/${videoId}?autoplay=0&loop=0`
|
|
57
|
-
);
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
describe("using embedCode prop", () => {
|
|
62
|
-
const embedCode = `<iframe src="https://player.vimeo.com/video/421404144?h=5467db7edd" width="640" height="360" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>`;
|
|
63
|
-
const embedCodeWithTitle = `<iframe title="Pre-Existing iFrame Title" src="https://player.vimeo.com/video/421404144?h=5467db7edd" width="640" height="360" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>`;
|
|
64
|
-
|
|
65
|
-
it("Renders custom embed code", () => {
|
|
66
|
-
render(<VideoPlayer embedCode={embedCode} />);
|
|
67
|
-
expect(screen.getByTitle("Video player")).toBeInTheDocument();
|
|
68
|
-
expect(screen.getByTitle("Video player")).toHaveAttribute(
|
|
69
|
-
"src",
|
|
70
|
-
`https://player.vimeo.com/video/421404144?h=5467db7edd`
|
|
71
|
-
);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it("Renders custom embed code with custom iframe title", () => {
|
|
75
|
-
render(
|
|
76
|
-
<VideoPlayer embedCode={embedCode} iframeTitle="Custom iFrame Title" />
|
|
77
|
-
);
|
|
78
|
-
expect(screen.getByTitle("Custom iFrame Title")).toBeInTheDocument();
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it("Renders custom embed code with pre-existing title", () => {
|
|
82
|
-
render(<VideoPlayer embedCode={embedCodeWithTitle} />);
|
|
83
|
-
expect(
|
|
84
|
-
screen.getByTitle("Pre-Existing iFrame Title")
|
|
85
|
-
).toBeInTheDocument();
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it("Renders custom embed code with pre-existing title and ignores `iframeTitle` prop", () => {
|
|
89
|
-
render(
|
|
90
|
-
<VideoPlayer
|
|
91
|
-
embedCode={embedCodeWithTitle}
|
|
92
|
-
iframeTitle="Custom iFrame Title"
|
|
93
|
-
/>
|
|
94
|
-
);
|
|
95
|
-
expect(
|
|
96
|
-
screen.getByTitle("Pre-Existing iFrame Title")
|
|
97
|
-
).toBeInTheDocument();
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
describe("text elements", () => {
|
|
102
|
-
beforeEach(() => {
|
|
103
|
-
utils = render(
|
|
104
|
-
<VideoPlayer
|
|
105
|
-
videoType="youtube"
|
|
106
|
-
videoId={videoId}
|
|
107
|
-
headingText="Video Player Heading"
|
|
108
|
-
descriptionText="Video Player description text."
|
|
109
|
-
helperText="Video Player helper text."
|
|
110
|
-
/>
|
|
111
|
-
);
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
it("Renders Heading component", () => {
|
|
115
|
-
expect(screen.getByText("Video Player Heading")).toBeInTheDocument();
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
it("Renders description text", () => {
|
|
119
|
-
expect(
|
|
120
|
-
screen.getByText("Video Player description text.")
|
|
121
|
-
).toBeInTheDocument();
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
it("Renders HelperErrorText component", () => {
|
|
125
|
-
expect(screen.getByText("Video Player helper text.")).toBeInTheDocument();
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
it("does not render the helper text", () => {
|
|
129
|
-
utils.rerender(
|
|
130
|
-
<VideoPlayer
|
|
131
|
-
videoType="youtube"
|
|
132
|
-
videoId={videoId}
|
|
133
|
-
headingText="Video Player Heading"
|
|
134
|
-
descriptionText="Video Player description text."
|
|
135
|
-
helperText="Video Player helper text."
|
|
136
|
-
showHelperInvalidText={false}
|
|
137
|
-
/>
|
|
138
|
-
);
|
|
139
|
-
expect(
|
|
140
|
-
screen.queryByText("Video Player helper text.")
|
|
141
|
-
).not.toBeInTheDocument();
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
describe("custom iframe title", () => {
|
|
146
|
-
it("Uses iframeTitle prop to add custom title attribute to iframe", () => {
|
|
147
|
-
render(
|
|
148
|
-
<VideoPlayer
|
|
149
|
-
videoType="vimeo"
|
|
150
|
-
videoId="474719268"
|
|
151
|
-
iframeTitle="My custom iframe title."
|
|
152
|
-
/>
|
|
153
|
-
);
|
|
154
|
-
expect(screen.getByTitle("My custom iframe title.")).toBeInTheDocument();
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
describe("prop validation", () => {
|
|
159
|
-
it("Throws error if the videoId prop not is formatted properly", () => {
|
|
160
|
-
render(
|
|
161
|
-
<VideoPlayer
|
|
162
|
-
videoType="vimeo"
|
|
163
|
-
videoId="http://vimeo.com/474719268"
|
|
164
|
-
aspectRatio="fourByThree"
|
|
165
|
-
/>
|
|
166
|
-
);
|
|
167
|
-
expect(
|
|
168
|
-
screen.getByText(
|
|
169
|
-
"This video player has not been configured properly. Please contact the site administrator."
|
|
170
|
-
)
|
|
171
|
-
).toBeInTheDocument();
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
it("Throws appropriate error if VideoPlayer props are not configured properly", () => {
|
|
175
|
-
const warn = jest.spyOn(console, "warn");
|
|
176
|
-
|
|
177
|
-
render(<VideoPlayer />);
|
|
178
|
-
expect(warn).toHaveBeenCalledWith(
|
|
179
|
-
"NYPL Reservoir VideoPlayer: Pass in either the `embedCode` prop or " +
|
|
180
|
-
"both the `videoType` and `videoId` props; none were passed."
|
|
181
|
-
);
|
|
182
|
-
|
|
183
|
-
render(<VideoPlayer videoId="http://vimeo.com/474719268" />);
|
|
184
|
-
expect(warn).toHaveBeenCalledWith(
|
|
185
|
-
"NYPL Reservoir VideoPlayer: The `videoType` prop is also required. " +
|
|
186
|
-
"Only the `videoId` prop was set."
|
|
187
|
-
);
|
|
188
|
-
|
|
189
|
-
render(<VideoPlayer videoType="vimeo" />);
|
|
190
|
-
expect(warn).toHaveBeenCalledWith(
|
|
191
|
-
"NYPL Reservoir VideoPlayer: The `videoId` prop is also required. " +
|
|
192
|
-
"Only the `videoType` prop was set."
|
|
193
|
-
);
|
|
194
|
-
|
|
195
|
-
render(
|
|
196
|
-
<VideoPlayer
|
|
197
|
-
embedCode="<iframe src='https://player.vimeo.com/video/421404144?h=5467db7edd' width='640' height='360' frameborder='0' allow='autoplay; fullscreen; picture-in-picture' allowfullscreen></iframe>"
|
|
198
|
-
videoType="vimeo"
|
|
199
|
-
videoId="http://vimeo.com/474719268"
|
|
200
|
-
/>
|
|
201
|
-
);
|
|
202
|
-
expect(warn).toHaveBeenCalledWith(
|
|
203
|
-
"NYPL Reservoir VideoPlayer: Pass in either the `embedCode` prop or " +
|
|
204
|
-
"both the `videoType` and `videoId` props; all were set."
|
|
205
|
-
);
|
|
206
|
-
|
|
207
|
-
render(
|
|
208
|
-
<VideoPlayer
|
|
209
|
-
embedCode="<iframe src='https://player.vimeo.com/video/421404144?h=5467db7edd' width='640' height='360' frameborder='0' allow='autoplay; fullscreen; picture-in-picture' allowfullscreen></iframe>"
|
|
210
|
-
videoType="vimeo"
|
|
211
|
-
/>
|
|
212
|
-
);
|
|
213
|
-
expect(warn).toHaveBeenCalledWith(
|
|
214
|
-
"NYPL Reservoir VideoPlayer: Pass in either the `embedCode` prop or " +
|
|
215
|
-
"both the `videoType` and `videoId` props; all were set."
|
|
216
|
-
);
|
|
217
|
-
|
|
218
|
-
render(
|
|
219
|
-
<VideoPlayer
|
|
220
|
-
embedCode="<iframe src='https://player.vimeo.com/video/421404144?h=5467db7edd' width='640' height='360' frameborder='0' allow='autoplay; fullscreen; picture-in-picture' allowfullscreen></iframe>"
|
|
221
|
-
videoId="http://vimeo.com/474719268"
|
|
222
|
-
/>
|
|
223
|
-
);
|
|
224
|
-
expect(warn).toHaveBeenCalledWith(
|
|
225
|
-
"NYPL Reservoir VideoPlayer: Pass in either the `embedCode` prop or " +
|
|
226
|
-
"both the `videoType` and `videoId` props; all were set."
|
|
227
|
-
);
|
|
228
|
-
|
|
229
|
-
const embedCode = `<iframe src="https://player./video/421404144?h=5467db7edd"></iframe>`;
|
|
230
|
-
render(<VideoPlayer embedCode={embedCode} />);
|
|
231
|
-
expect(warn).toHaveBeenCalledWith(
|
|
232
|
-
"NYPL Reservoir VideoPlayer: The `embedCode` prop is not configured properly."
|
|
233
|
-
);
|
|
234
|
-
});
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
it("renders the UI snapshot correctly", () => {
|
|
238
|
-
const videoPlayerWithoutText = renderer
|
|
239
|
-
.create(
|
|
240
|
-
<VideoPlayer
|
|
241
|
-
id="video-player-without-text"
|
|
242
|
-
videoId="474719268"
|
|
243
|
-
videoType="vimeo"
|
|
244
|
-
/>
|
|
245
|
-
)
|
|
246
|
-
.toJSON();
|
|
247
|
-
const videoPlayerWithText = renderer
|
|
248
|
-
.create(
|
|
249
|
-
<VideoPlayer
|
|
250
|
-
descriptionText="VideoPlayer description"
|
|
251
|
-
headingText="VideoPlayer Heading"
|
|
252
|
-
id="video-player-with-text"
|
|
253
|
-
helperText="VideoPlayer helper test."
|
|
254
|
-
videoId="474719268"
|
|
255
|
-
videoType="vimeo"
|
|
256
|
-
/>
|
|
257
|
-
)
|
|
258
|
-
.toJSON();
|
|
259
|
-
const videoPlayerUsingEmbedCode = renderer
|
|
260
|
-
.create(
|
|
261
|
-
<VideoPlayer
|
|
262
|
-
descriptionText="VideoPlayer description"
|
|
263
|
-
embedCode="<iframe src='https://player.vimeo.com/video/421404144?h=5467db7edd' width='640' height='360' frameborder='0' allow='autoplay; fullscreen; picture-in-picture' allowfullscreen></iframe>"
|
|
264
|
-
headingText="VideoPlayer Heading"
|
|
265
|
-
id="video-player-with-text"
|
|
266
|
-
helperText="VideoPlayer helper test."
|
|
267
|
-
/>
|
|
268
|
-
)
|
|
269
|
-
.toJSON();
|
|
270
|
-
const videoPlayerError = renderer
|
|
271
|
-
.create(
|
|
272
|
-
<VideoPlayer
|
|
273
|
-
id="video-player-error"
|
|
274
|
-
videoId="https://vimeo.com/474719268"
|
|
275
|
-
videoType="vimeo"
|
|
276
|
-
/>
|
|
277
|
-
)
|
|
278
|
-
.toJSON();
|
|
279
|
-
const withChakraProps = renderer
|
|
280
|
-
.create(
|
|
281
|
-
<VideoPlayer
|
|
282
|
-
id="chakra"
|
|
283
|
-
videoId="474719268"
|
|
284
|
-
videoType="vimeo"
|
|
285
|
-
p="20px"
|
|
286
|
-
color="ui.error.primary"
|
|
287
|
-
/>
|
|
288
|
-
)
|
|
289
|
-
.toJSON();
|
|
290
|
-
const withOtherProps = renderer
|
|
291
|
-
.create(
|
|
292
|
-
<VideoPlayer
|
|
293
|
-
id="props"
|
|
294
|
-
videoId="474719268"
|
|
295
|
-
videoType="vimeo"
|
|
296
|
-
data-testid="props"
|
|
297
|
-
/>
|
|
298
|
-
)
|
|
299
|
-
.toJSON();
|
|
300
|
-
|
|
301
|
-
expect(videoPlayerWithoutText).toMatchSnapshot();
|
|
302
|
-
expect(videoPlayerWithText).toMatchSnapshot();
|
|
303
|
-
expect(videoPlayerUsingEmbedCode).toMatchSnapshot();
|
|
304
|
-
expect(videoPlayerError).toMatchSnapshot();
|
|
305
|
-
expect(withChakraProps).toMatchSnapshot();
|
|
306
|
-
expect(withOtherProps).toMatchSnapshot();
|
|
307
|
-
});
|
|
308
|
-
});
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { Box, chakra, useMultiStyleConfig } from "@chakra-ui/react";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
import ComponentWrapper from "../ComponentWrapper/ComponentWrapper";
|
|
5
|
-
import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
|
|
6
|
-
|
|
7
|
-
export type VideoPlayerTypes = "vimeo" | "youtube";
|
|
8
|
-
export type VideoPlayerAspectRatios =
|
|
9
|
-
| "fourByThree"
|
|
10
|
-
| "sixteenByNine"
|
|
11
|
-
| "square";
|
|
12
|
-
export interface VideoPlayerProps {
|
|
13
|
-
/** Optional aspect ratio prop to control the sizing of the video player; if
|
|
14
|
-
* omitted, the video player defaults to `sixteen-by-nine` */
|
|
15
|
-
aspectRatio?: VideoPlayerAspectRatios;
|
|
16
|
-
/** Optional className you can add in addition to `video-player` */
|
|
17
|
-
className?: string;
|
|
18
|
-
/** Optional string to set the text for a video description */
|
|
19
|
-
descriptionText?: string;
|
|
20
|
-
/** Optional string to set a code snippet provided by YouTube or Vimeo; the
|
|
21
|
-
* `videoPlayer` component will accept the `embedCode` prop or the `videoId`
|
|
22
|
-
* and `videoType` props */
|
|
23
|
-
embedCode?: string;
|
|
24
|
-
/** Optional string to set the text for a `Heading` component */
|
|
25
|
-
headingText?: string;
|
|
26
|
-
/** Optional string to set the text for a `HelperErrorText` component */
|
|
27
|
-
helperText?: HelperErrorTextType;
|
|
28
|
-
/** ID that other components can cross reference for accessibility purposes */
|
|
29
|
-
id?: string;
|
|
30
|
-
/** Optional title to be added to the `<iframe>` element for improved
|
|
31
|
-
* accessibility; this title should describe in a few words the content of
|
|
32
|
-
* the video; if omitted, a generic title will be added; if a `title`
|
|
33
|
-
* attribute is already present in the `embedCode` prop, this prop will be
|
|
34
|
-
* ignored */
|
|
35
|
-
iframeTitle?: string;
|
|
36
|
-
/** Offers the ability to hide the helper/invalid text. */
|
|
37
|
-
showHelperInvalidText?: boolean;
|
|
38
|
-
/** Required YouTube or Vimeo video ID. This value can be pulled from a
|
|
39
|
-
* video's YouTube or Vimeo URL. */
|
|
40
|
-
videoId?: string;
|
|
41
|
-
/** Required. Used to specify which video service is being used. */
|
|
42
|
-
videoType?: VideoPlayerTypes;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export const VideoPlayer = chakra(
|
|
46
|
-
(props: React.PropsWithChildren<VideoPlayerProps>) => {
|
|
47
|
-
const {
|
|
48
|
-
aspectRatio,
|
|
49
|
-
className,
|
|
50
|
-
descriptionText,
|
|
51
|
-
embedCode,
|
|
52
|
-
headingText,
|
|
53
|
-
helperText,
|
|
54
|
-
id,
|
|
55
|
-
iframeTitle,
|
|
56
|
-
showHelperInvalidText = true,
|
|
57
|
-
videoId,
|
|
58
|
-
videoType,
|
|
59
|
-
...rest
|
|
60
|
-
} = props;
|
|
61
|
-
|
|
62
|
-
const iframeTitleFinal =
|
|
63
|
-
videoType === "vimeo"
|
|
64
|
-
? iframeTitle || "Vimeo video player"
|
|
65
|
-
: iframeTitle || "YouTube video player";
|
|
66
|
-
|
|
67
|
-
const videoSrc =
|
|
68
|
-
videoType === "vimeo"
|
|
69
|
-
? `https://player.vimeo.com/video/${videoId}?autoplay=0&loop=0`
|
|
70
|
-
: `https://www.youtube.com/embed/${videoId}?disablekb=1&autoplay=0&fs=1&modestbranding=0`;
|
|
71
|
-
|
|
72
|
-
const iFrameTitleEmbedCode = iframeTitle
|
|
73
|
-
? `${iframeTitle}`
|
|
74
|
-
: `Video player`;
|
|
75
|
-
|
|
76
|
-
const embedCodeFinal =
|
|
77
|
-
embedCode &&
|
|
78
|
-
embedCode.includes("<iframe") &&
|
|
79
|
-
!embedCode.includes("title=")
|
|
80
|
-
? embedCode.replace(
|
|
81
|
-
`<iframe `,
|
|
82
|
-
`<iframe title="${iFrameTitleEmbedCode}" `
|
|
83
|
-
)
|
|
84
|
-
: embedCode;
|
|
85
|
-
|
|
86
|
-
const errorMessage =
|
|
87
|
-
"<strong>Error:</strong> This video player has not been configured " +
|
|
88
|
-
"properly. Please contact the site administrator.";
|
|
89
|
-
|
|
90
|
-
let isInvalid = false;
|
|
91
|
-
if (!embedCodeFinal && !videoType && !videoId) {
|
|
92
|
-
console.warn(
|
|
93
|
-
"NYPL Reservoir VideoPlayer: Pass in either the `embedCode` prop or " +
|
|
94
|
-
"both the `videoType` and `videoId` props; none were passed."
|
|
95
|
-
);
|
|
96
|
-
isInvalid = true;
|
|
97
|
-
} else if (!embedCodeFinal && !videoType) {
|
|
98
|
-
console.warn(
|
|
99
|
-
"NYPL Reservoir VideoPlayer: The `videoType` prop is also required. " +
|
|
100
|
-
"Only the `videoId` prop was set."
|
|
101
|
-
);
|
|
102
|
-
isInvalid = true;
|
|
103
|
-
} else if (!embedCodeFinal && !videoId) {
|
|
104
|
-
console.warn(
|
|
105
|
-
"NYPL Reservoir VideoPlayer: The `videoId` prop is also required. " +
|
|
106
|
-
"Only the `videoType` prop was set."
|
|
107
|
-
);
|
|
108
|
-
isInvalid = true;
|
|
109
|
-
} else if (embedCodeFinal && (videoType || videoId)) {
|
|
110
|
-
console.warn(
|
|
111
|
-
"NYPL Reservoir VideoPlayer: Pass in either the `embedCode` prop or " +
|
|
112
|
-
"both the `videoType` and `videoId` props; all were set."
|
|
113
|
-
);
|
|
114
|
-
isInvalid = true;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (
|
|
118
|
-
videoId &&
|
|
119
|
-
(videoId.includes("://") ||
|
|
120
|
-
videoId.includes("http") ||
|
|
121
|
-
videoId.includes(".") ||
|
|
122
|
-
videoId.includes("youtube") ||
|
|
123
|
-
videoId.includes("vimeo"))
|
|
124
|
-
) {
|
|
125
|
-
console.warn(
|
|
126
|
-
"NYPL Reservoir VideoPlayer: The `videoId` prop is not configured properly."
|
|
127
|
-
);
|
|
128
|
-
isInvalid = true;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (
|
|
132
|
-
embedCodeFinal &&
|
|
133
|
-
((!embedCodeFinal.includes("vimeo.com") &&
|
|
134
|
-
!embedCodeFinal.includes("youtube.com")) ||
|
|
135
|
-
!embedCodeFinal.includes("<iframe") ||
|
|
136
|
-
!embedCodeFinal.includes("</iframe"))
|
|
137
|
-
) {
|
|
138
|
-
console.warn(
|
|
139
|
-
"NYPL Reservoir VideoPlayer: The `embedCode` prop is not configured properly."
|
|
140
|
-
);
|
|
141
|
-
isInvalid = true;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
const variant = isInvalid ? "invalid" : aspectRatio;
|
|
145
|
-
const styles = useMultiStyleConfig("VideoPlayer", { variant });
|
|
146
|
-
|
|
147
|
-
const embedElement = embedCodeFinal ? (
|
|
148
|
-
<span dangerouslySetInnerHTML={{ __html: embedCodeFinal }} />
|
|
149
|
-
) : (
|
|
150
|
-
<Box
|
|
151
|
-
as="iframe"
|
|
152
|
-
src={videoSrc}
|
|
153
|
-
title={iframeTitleFinal}
|
|
154
|
-
frameBorder="0"
|
|
155
|
-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture"
|
|
156
|
-
allowFullScreen
|
|
157
|
-
__css={styles.iframe}
|
|
158
|
-
/>
|
|
159
|
-
);
|
|
160
|
-
|
|
161
|
-
return (
|
|
162
|
-
<Box
|
|
163
|
-
className={className}
|
|
164
|
-
data-testid="video-player-component"
|
|
165
|
-
id={id}
|
|
166
|
-
__css={styles}
|
|
167
|
-
{...rest}
|
|
168
|
-
>
|
|
169
|
-
{isInvalid ? (
|
|
170
|
-
<span dangerouslySetInnerHTML={{ __html: errorMessage }} />
|
|
171
|
-
) : (
|
|
172
|
-
<ComponentWrapper
|
|
173
|
-
headingText={headingText ? headingText : undefined}
|
|
174
|
-
descriptionText={descriptionText ? descriptionText : undefined}
|
|
175
|
-
helperText={
|
|
176
|
-
helperText && showHelperInvalidText ? helperText : undefined
|
|
177
|
-
}
|
|
178
|
-
id={`${id}-componentWrapper`}
|
|
179
|
-
>
|
|
180
|
-
<Box __css={styles.inside}>{embedElement}</Box>
|
|
181
|
-
</ComponentWrapper>
|
|
182
|
-
)}
|
|
183
|
-
</Box>
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
);
|
|
187
|
-
|
|
188
|
-
export default VideoPlayer;
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`VideoPlayer renders the UI snapshot correctly 1`] = `
|
|
4
|
-
<div
|
|
5
|
-
className="css-1xdhyk6"
|
|
6
|
-
data-testid="video-player-component"
|
|
7
|
-
id="video-player-without-text"
|
|
8
|
-
>
|
|
9
|
-
<div
|
|
10
|
-
className="css-1xdhyk6"
|
|
11
|
-
>
|
|
12
|
-
<div
|
|
13
|
-
className="css-0"
|
|
14
|
-
>
|
|
15
|
-
<iframe
|
|
16
|
-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture"
|
|
17
|
-
allowFullScreen={true}
|
|
18
|
-
className="css-0"
|
|
19
|
-
frameBorder="0"
|
|
20
|
-
src="https://player.vimeo.com/video/474719268?autoplay=0&loop=0"
|
|
21
|
-
title="Vimeo video player"
|
|
22
|
-
/>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
`;
|
|
27
|
-
|
|
28
|
-
exports[`VideoPlayer renders the UI snapshot correctly 2`] = `
|
|
29
|
-
<div
|
|
30
|
-
className="css-1xdhyk6"
|
|
31
|
-
data-testid="video-player-component"
|
|
32
|
-
id="video-player-with-text"
|
|
33
|
-
>
|
|
34
|
-
<div
|
|
35
|
-
className="css-1xdhyk6"
|
|
36
|
-
>
|
|
37
|
-
<h2
|
|
38
|
-
className="chakra-heading css-1xdhyk6"
|
|
39
|
-
id="video-player-with-text-componentWrapper-heading"
|
|
40
|
-
>
|
|
41
|
-
VideoPlayer Heading
|
|
42
|
-
</h2>
|
|
43
|
-
<p
|
|
44
|
-
className="chakra-text css-1xdhyk6"
|
|
45
|
-
>
|
|
46
|
-
VideoPlayer description
|
|
47
|
-
</p>
|
|
48
|
-
<div
|
|
49
|
-
className="css-0"
|
|
50
|
-
>
|
|
51
|
-
<iframe
|
|
52
|
-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture"
|
|
53
|
-
allowFullScreen={true}
|
|
54
|
-
className="css-0"
|
|
55
|
-
frameBorder="0"
|
|
56
|
-
src="https://player.vimeo.com/video/474719268?autoplay=0&loop=0"
|
|
57
|
-
title="Vimeo video player"
|
|
58
|
-
/>
|
|
59
|
-
</div>
|
|
60
|
-
<div
|
|
61
|
-
aria-atomic={true}
|
|
62
|
-
aria-live="off"
|
|
63
|
-
className="css-1xdhyk6"
|
|
64
|
-
dangerouslySetInnerHTML={
|
|
65
|
-
Object {
|
|
66
|
-
"__html": "VideoPlayer helper test.",
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
data-isinvalid={false}
|
|
70
|
-
id="video-player-with-text-componentWrapper-helperText"
|
|
71
|
-
/>
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
`;
|
|
75
|
-
|
|
76
|
-
exports[`VideoPlayer renders the UI snapshot correctly 3`] = `
|
|
77
|
-
<div
|
|
78
|
-
className="css-1xdhyk6"
|
|
79
|
-
data-testid="video-player-component"
|
|
80
|
-
id="video-player-with-text"
|
|
81
|
-
>
|
|
82
|
-
<div
|
|
83
|
-
className="css-1xdhyk6"
|
|
84
|
-
>
|
|
85
|
-
<h2
|
|
86
|
-
className="chakra-heading css-1xdhyk6"
|
|
87
|
-
id="video-player-with-text-componentWrapper-heading"
|
|
88
|
-
>
|
|
89
|
-
VideoPlayer Heading
|
|
90
|
-
</h2>
|
|
91
|
-
<p
|
|
92
|
-
className="chakra-text css-1xdhyk6"
|
|
93
|
-
>
|
|
94
|
-
VideoPlayer description
|
|
95
|
-
</p>
|
|
96
|
-
<div
|
|
97
|
-
className="css-0"
|
|
98
|
-
>
|
|
99
|
-
<span
|
|
100
|
-
dangerouslySetInnerHTML={
|
|
101
|
-
Object {
|
|
102
|
-
"__html": "<iframe title=\\"Video player\\" src='https://player.vimeo.com/video/421404144?h=5467db7edd' width='640' height='360' frameborder='0' allow='autoplay; fullscreen; picture-in-picture' allowfullscreen></iframe>",
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
/>
|
|
106
|
-
</div>
|
|
107
|
-
<div
|
|
108
|
-
aria-atomic={true}
|
|
109
|
-
aria-live="off"
|
|
110
|
-
className="css-1xdhyk6"
|
|
111
|
-
dangerouslySetInnerHTML={
|
|
112
|
-
Object {
|
|
113
|
-
"__html": "VideoPlayer helper test.",
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
data-isinvalid={false}
|
|
117
|
-
id="video-player-with-text-componentWrapper-helperText"
|
|
118
|
-
/>
|
|
119
|
-
</div>
|
|
120
|
-
</div>
|
|
121
|
-
`;
|
|
122
|
-
|
|
123
|
-
exports[`VideoPlayer renders the UI snapshot correctly 4`] = `
|
|
124
|
-
<div
|
|
125
|
-
className="css-1xdhyk6"
|
|
126
|
-
data-testid="video-player-component"
|
|
127
|
-
id="video-player-error"
|
|
128
|
-
>
|
|
129
|
-
<span
|
|
130
|
-
dangerouslySetInnerHTML={
|
|
131
|
-
Object {
|
|
132
|
-
"__html": "<strong>Error:</strong> This video player has not been configured properly. Please contact the site administrator.",
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
/>
|
|
136
|
-
</div>
|
|
137
|
-
`;
|
|
138
|
-
|
|
139
|
-
exports[`VideoPlayer renders the UI snapshot correctly 5`] = `
|
|
140
|
-
<div
|
|
141
|
-
className="css-kle7zy"
|
|
142
|
-
data-testid="video-player-component"
|
|
143
|
-
id="chakra"
|
|
144
|
-
>
|
|
145
|
-
<div
|
|
146
|
-
className="css-1xdhyk6"
|
|
147
|
-
>
|
|
148
|
-
<div
|
|
149
|
-
className="css-0"
|
|
150
|
-
>
|
|
151
|
-
<iframe
|
|
152
|
-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture"
|
|
153
|
-
allowFullScreen={true}
|
|
154
|
-
className="css-0"
|
|
155
|
-
frameBorder="0"
|
|
156
|
-
src="https://player.vimeo.com/video/474719268?autoplay=0&loop=0"
|
|
157
|
-
title="Vimeo video player"
|
|
158
|
-
/>
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
</div>
|
|
162
|
-
`;
|
|
163
|
-
|
|
164
|
-
exports[`VideoPlayer renders the UI snapshot correctly 6`] = `
|
|
165
|
-
<div
|
|
166
|
-
className="css-1xdhyk6"
|
|
167
|
-
data-testid="props"
|
|
168
|
-
id="props"
|
|
169
|
-
>
|
|
170
|
-
<div
|
|
171
|
-
className="css-1xdhyk6"
|
|
172
|
-
>
|
|
173
|
-
<div
|
|
174
|
-
className="css-0"
|
|
175
|
-
>
|
|
176
|
-
<iframe
|
|
177
|
-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture"
|
|
178
|
-
allowFullScreen={true}
|
|
179
|
-
className="css-0"
|
|
180
|
-
frameBorder="0"
|
|
181
|
-
src="https://player.vimeo.com/video/474719268?autoplay=0&loop=0"
|
|
182
|
-
title="Vimeo video player"
|
|
183
|
-
/>
|
|
184
|
-
</div>
|
|
185
|
-
</div>
|
|
186
|
-
</div>
|
|
187
|
-
`;
|