@brightcove/components-embed-code-modal 0.8.3 → 0.8.4

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 (158) hide show
  1. package/__tests__/EmbedCode.test.d.ts +2 -0
  2. package/__tests__/EmbedCode.test.d.ts.map +1 -0
  3. package/__tests__/InteractivityProject.test.d.ts +2 -0
  4. package/__tests__/InteractivityProject.test.d.ts.map +1 -0
  5. package/__tests__/PlayerPreview.test.d.ts +2 -0
  6. package/__tests__/PlayerPreview.test.d.ts.map +1 -0
  7. package/__tests__/TabsHeader.test.d.ts +2 -0
  8. package/__tests__/TabsHeader.test.d.ts.map +1 -0
  9. package/__tests__/TabsSection.test.d.ts +2 -0
  10. package/__tests__/TabsSection.test.d.ts.map +1 -0
  11. package/__tests__/TitleWithTooltip.test.d.ts +2 -0
  12. package/__tests__/TitleWithTooltip.test.d.ts.map +1 -0
  13. package/__tests__/VideoPlayer.test.d.ts +2 -0
  14. package/__tests__/VideoPlayer.test.d.ts.map +1 -0
  15. package/__tests__/util.test.d.ts +2 -0
  16. package/__tests__/util.test.d.ts.map +1 -0
  17. package/index.js +56 -0
  18. package/index.js.map +1 -0
  19. package/package.json +5 -15
  20. package/src/index.d.ts +5 -0
  21. package/src/index.d.ts.map +1 -0
  22. package/src/js/EmbedCodeModal.d.ts +17 -0
  23. package/src/js/EmbedCodeModal.d.ts.map +1 -0
  24. package/src/js/components/CustomSettingsDropdown.d.ts +11 -0
  25. package/src/js/components/CustomSettingsDropdown.d.ts.map +1 -0
  26. package/src/js/components/EmbedCopySection.d.ts +4 -0
  27. package/src/js/components/EmbedCopySection.d.ts.map +1 -0
  28. package/src/js/components/ModalContainer.d.ts +17 -0
  29. package/src/js/components/ModalContainer.d.ts.map +1 -0
  30. package/src/js/components/NoPlayerModal.d.ts +8 -0
  31. package/src/js/components/NoPlayerModal.d.ts.map +1 -0
  32. package/src/js/components/PlayerPreview.d.ts +4 -0
  33. package/src/js/components/PlayerPreview.d.ts.map +1 -0
  34. package/src/js/components/TabsHeader.d.ts +11 -0
  35. package/src/js/components/TabsHeader.d.ts.map +1 -0
  36. package/src/js/components/TabsSection.d.ts +15 -0
  37. package/src/js/components/TabsSection.d.ts.map +1 -0
  38. package/src/js/components/TitleWithTooltip.d.ts +8 -0
  39. package/src/js/components/TitleWithTooltip.d.ts.map +1 -0
  40. package/src/js/components/VideoLinks.d.ts +9 -0
  41. package/src/js/components/VideoLinks.d.ts.map +1 -0
  42. package/src/js/components/VideoPlayer.d.ts +17 -0
  43. package/src/js/components/VideoPlayer.d.ts.map +1 -0
  44. package/src/js/components/{index.ts → index.d.ts} +1 -0
  45. package/src/js/components/index.d.ts.map +1 -0
  46. package/src/js/constants/baseUrls.d.ts +5 -0
  47. package/src/js/constants/baseUrls.d.ts.map +1 -0
  48. package/src/js/constants/embed.d.ts +9 -0
  49. package/src/js/constants/embed.d.ts.map +1 -0
  50. package/src/js/constants/player.d.ts +27 -0
  51. package/src/js/constants/player.d.ts.map +1 -0
  52. package/src/js/constants/pluginsRegistry.d.ts +7 -0
  53. package/src/js/constants/pluginsRegistry.d.ts.map +1 -0
  54. package/src/js/hooks/useGetPlayers.d.ts +3 -0
  55. package/src/js/hooks/useGetPlayers.d.ts.map +1 -0
  56. package/src/js/i18n.d.ts +335 -0
  57. package/src/js/i18n.d.ts.map +1 -0
  58. package/src/js/services/players-api.d.ts +5 -0
  59. package/src/js/services/players-api.d.ts.map +1 -0
  60. package/src/js/services/url-shortener.d.ts +4 -0
  61. package/src/js/services/url-shortener.d.ts.map +1 -0
  62. package/src/js/types/EmbedCodeModalProps.d.ts +59 -0
  63. package/src/js/types/EmbedCodeModalProps.d.ts.map +1 -0
  64. package/src/js/types/EmbedCodeProps.d.ts +13 -0
  65. package/src/js/types/EmbedCodeProps.d.ts.map +1 -0
  66. package/src/js/types/players.d.ts +58 -0
  67. package/src/js/types/players.d.ts.map +1 -0
  68. package/src/js/types/studioModule.d.ts +8 -0
  69. package/src/js/types/studioModule.d.ts.map +1 -0
  70. package/src/js/utils/addPluginsDataToPlayers.d.ts +6 -0
  71. package/src/js/utils/addPluginsDataToPlayers.d.ts.map +1 -0
  72. package/src/js/utils/call.d.ts +14 -0
  73. package/src/js/utils/call.d.ts.map +1 -0
  74. package/src/js/utils/dimensions.d.ts +9 -0
  75. package/src/js/utils/dimensions.d.ts.map +1 -0
  76. package/src/js/utils/featureSwitches.d.ts +2 -0
  77. package/src/js/utils/featureSwitches.d.ts.map +1 -0
  78. package/src/js/utils/util.d.ts +67 -0
  79. package/src/js/utils/util.d.ts.map +1 -0
  80. package/src/module.d.ts +2 -0
  81. package/src/module.d.ts.map +1 -0
  82. package/src/styles/typings.td.d.ts +13 -0
  83. package/src/styles/typings.td.d.ts.map +1 -0
  84. package/src/types/studio.d.ts +202 -0
  85. package/src/types/studio.d.ts.map +1 -0
  86. package/.eslintignore +0 -7
  87. package/.eslintrc +0 -23
  88. package/.husky/pre-commit +0 -4
  89. package/.nvmrc +0 -1
  90. package/.prettierignore +0 -7
  91. package/.prettierrc +0 -5
  92. package/.release-it.json +0 -40
  93. package/.whitesource +0 -3
  94. package/CHANGELOG.md +0 -342
  95. package/CODEOWNERS +0 -37
  96. package/PULL_REQUEST_TEMPLATE.md +0 -17
  97. package/__tests__/EmbedCode.test.tsx +0 -51
  98. package/__tests__/InteractivityProject.test.tsx +0 -50
  99. package/__tests__/PlayerPreview.test.tsx +0 -23
  100. package/__tests__/TabsHeader.test.tsx +0 -19
  101. package/__tests__/TabsSection.test.tsx +0 -46
  102. package/__tests__/TitleWithTooltip.test.tsx +0 -45
  103. package/__tests__/VideoPlayer.test.tsx +0 -38
  104. package/__tests__/util.test.ts +0 -89
  105. package/babel.config.json +0 -17
  106. package/etc/wildcard.brightcove.com.key +0 -27
  107. package/etc/wildcard.brightcove.com.pem +0 -96
  108. package/jest/jest.setup.js +0 -62
  109. package/jest/jest.stub.js +0 -4
  110. package/jest.config.js +0 -24
  111. package/scripts/create-dist-pkg-prod.js +0 -18
  112. package/src/index.ts +0 -16
  113. package/src/js/EmbedCodeModal.tsx +0 -88
  114. package/src/js/components/CustomSettingsDropdown.tsx +0 -184
  115. package/src/js/components/EmbedCopySection.tsx +0 -130
  116. package/src/js/components/ModalContainer.tsx +0 -274
  117. package/src/js/components/NoPlayerModal.tsx +0 -42
  118. package/src/js/components/PlayerPreview.tsx +0 -116
  119. package/src/js/components/TabsHeader.tsx +0 -31
  120. package/src/js/components/TabsSection.tsx +0 -74
  121. package/src/js/components/TitleWithTooltip.tsx +0 -39
  122. package/src/js/components/VideoLinks.tsx +0 -83
  123. package/src/js/components/VideoPlayer.tsx +0 -303
  124. package/src/js/constants/baseUrls.ts +0 -4
  125. package/src/js/constants/embed.ts +0 -12
  126. package/src/js/constants/player.ts +0 -32
  127. package/src/js/constants/pluginsRegistry.ts +0 -30
  128. package/src/js/hooks/useGetPlayers.ts +0 -12
  129. package/src/js/i18n.ts +0 -43
  130. package/src/js/services/players-api.ts +0 -26
  131. package/src/js/services/url-shortener.ts +0 -10
  132. package/src/js/types/EmbedCodeModalProps.ts +0 -72
  133. package/src/js/types/EmbedCodeProps.ts +0 -13
  134. package/src/js/types/brightcoveEmbedCode.d.ts +0 -18
  135. package/src/js/types/players.ts +0 -64
  136. package/src/js/types/react-i18next.d.ts +0 -8
  137. package/src/js/types/studioModule.ts +0 -7
  138. package/src/js/utils/addPluginsDataToPlayers.ts +0 -59
  139. package/src/js/utils/call.ts +0 -31
  140. package/src/js/utils/dimensions.ts +0 -53
  141. package/src/js/utils/featureSwitches.ts +0 -16
  142. package/src/js/utils/util.ts +0 -153
  143. package/src/module.tsx +0 -246
  144. package/src/styles/CustomSettingsDropdown.sass +0 -42
  145. package/src/styles/EmbedCode.sass +0 -30
  146. package/src/styles/EmbedCodeModal.sass +0 -76
  147. package/src/styles/base.sass +0 -1
  148. package/src/styles/theme.sass +0 -11
  149. package/src/styles/typings.td.ts +0 -9
  150. package/src/translations/en.json +0 -53
  151. package/src/translations/es.json +0 -53
  152. package/src/translations/fr.json +0 -53
  153. package/src/translations/ja.json +0 -53
  154. package/src/translations/ko.json +0 -53
  155. package/src/translations/zh.json +0 -53
  156. package/src/types/studio.ts +0 -197
  157. package/tsconfig.json +0 -34
  158. package/webpack.config.js +0 -97
package/CODEOWNERS DELETED
@@ -1,37 +0,0 @@
1
- # This is a comment.
2
- # Each line is a file pattern followed by one or more owners.
3
-
4
- # These owners will be the default owners for everything in
5
- # the repo. Unless a later match takes precedence,
6
- # @global-owner1 and @global-owner2 will be requested for
7
- # review when someone opens a pull request.
8
- * @studio-ui-kit/player-customization-team
9
-
10
- # Order is important; the last matching pattern takes the most
11
- # precedence. When someone opens a pull request that only
12
- # modifies JS files, only @js-owner and not the global
13
- # owner(s) will be requested for a review.
14
- # *.js @js-owner
15
-
16
- # You can also use email addresses if you prefer. They'll be
17
- # used to look up users just like we do for commit author
18
- # emails.
19
- # *.go docs@example.com
20
-
21
- # In this example, @doctocat owns any files in the build/logs
22
- # directory at the root of the repository and any of its
23
- # subdirectories.
24
- # /build/logs/ @doctocat
25
-
26
- # The `docs/*` pattern will match files like
27
- # `docs/getting-started.md` but not further nested files like
28
- # `docs/build-app/troubleshooting.md`.
29
- # docs/* docs@example.com
30
-
31
- # In this example, @octocat owns any file in an apps directory
32
- # anywhere in your repository.
33
- # apps/ @octocat
34
-
35
- # In this example, @doctocat owns any file in the `/docs`
36
- # directory in the root of your repository.
37
- # /docs/ @doctocat
@@ -1,17 +0,0 @@
1
- ## Description
2
-
3
- Give context for the issue/feature you worked on and a brief explanation on how you solved it.
4
-
5
- ## Screenshots _[Optional]_
6
-
7
- If applicable, attach images of the before and after of the changes
8
-
9
- ## PR Checklist
10
-
11
- - [ ] New components have `testName` or `data-test-name` props
12
-
13
- _Checklist items are optional if you do not need to make any changes to them_
14
-
15
- ## Link to issue
16
-
17
- Link to Jira ticket
@@ -1,51 +0,0 @@
1
- import React from 'react';
2
- import { render } from '@testing-library/react';
3
- import { ModalContainer } from '../src/js/components';
4
- import { EmbedCodeModalTypes } from '../src';
5
- import { QueryClientProvider, QueryClient } from 'react-query';
6
-
7
- const DEFAULT_MODAL_COMP = {
8
- videoId: '123',
9
- videoName: 'test video',
10
- accountId: '456',
11
- duration: 10,
12
- };
13
-
14
- const wrappedComponent = (children: React.ReactElement) => (
15
- <QueryClientProvider client={new QueryClient()}>
16
- {children}
17
- </QueryClientProvider>
18
- );
19
-
20
- const handleSetComponentKey = jest.fn;
21
- const handleSetHasCreatedPlayer = jest.fn;
22
-
23
- test('does not render player with wrong information but right type', () => {
24
- const { container } = render(
25
- wrappedComponent(
26
- <ModalContainer
27
- handleSetComponentKey={handleSetComponentKey}
28
- data={DEFAULT_MODAL_COMP}
29
- hasCreatedPlayer={false}
30
- handleSetHasCreatedPlayer={handleSetHasCreatedPlayer}
31
- embedCodeModalType={EmbedCodeModalTypes.PLAYER}
32
- />,
33
- ),
34
- );
35
- expect(container.innerHTML).toBe('');
36
- });
37
-
38
- test('does not render project with wrong information but right type', () => {
39
- const { container } = render(
40
- wrappedComponent(
41
- <ModalContainer
42
- handleSetComponentKey={handleSetComponentKey}
43
- data={DEFAULT_MODAL_COMP}
44
- hasCreatedPlayer={false}
45
- handleSetHasCreatedPlayer={handleSetHasCreatedPlayer}
46
- embedCodeModalType={EmbedCodeModalTypes.PROJECT}
47
- />,
48
- ),
49
- );
50
- expect(container.innerHTML).toBe('');
51
- });
@@ -1,50 +0,0 @@
1
- import React from 'react';
2
- import { QueryClientProvider, QueryClient } from 'react-query';
3
- import { render, screen } from '@testing-library/react';
4
- import { VideoPlayer } from 'js/components';
5
- import { EmbedCodeModalTypes } from 'js/types/EmbedCodeModalProps';
6
- import { PLAYER_LIST_FOR_SELECTION, PLAYERS } from 'js/constants/player';
7
-
8
- jest.mock('../src/js/utils/featureSwitches');
9
-
10
- const wrappedComponent = (children: React.ReactElement) => (
11
- <QueryClientProvider client={new QueryClient()}>
12
- {children}
13
- </QueryClientProvider>
14
- );
15
-
16
- const DEFAULT_MODAL_COMP = {
17
- videoId: '123',
18
- videoName: 'test video',
19
- interactivityProjectId: '9876',
20
- interactivityProjectName: 'test project',
21
- accountId: '456',
22
- duration: 10,
23
- };
24
-
25
- test('renders EmbedCodeModal component with right information', () => {
26
- render(
27
- wrappedComponent(
28
- <VideoPlayer
29
- video={DEFAULT_MODAL_COMP}
30
- embedCodeModalType={EmbedCodeModalTypes.PROJECT}
31
- playerListForSelection={PLAYER_LIST_FOR_SELECTION}
32
- players={PLAYERS}
33
- />,
34
- ),
35
- );
36
- expect(
37
- screen.getByText(DEFAULT_MODAL_COMP.interactivityProjectId),
38
- ).toBeInTheDocument();
39
- expect(
40
- screen.getByText(DEFAULT_MODAL_COMP.interactivityProjectName),
41
- ).toBeInTheDocument();
42
- expect(
43
- screen.queryByText(DEFAULT_MODAL_COMP.videoId),
44
- ).not.toBeInTheDocument();
45
- expect(
46
- screen.queryByText(DEFAULT_MODAL_COMP.videoName),
47
- ).not.toBeInTheDocument();
48
- expect(screen.getByRole('tab', { name: /javascript/i })).toBeInTheDocument();
49
- expect(screen.getByRole('tab', { name: /IFrame/i })).toBeInTheDocument();
50
- });
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import { render, screen } from '@testing-library/react';
3
- import { PlayerPreview } from '../src/js/components';
4
- import { QueryClientProvider, QueryClient } from 'react-query';
5
-
6
- const DEFAULT_MODAL_COMP = {
7
- id: 'default',
8
- accountId: '456',
9
- };
10
-
11
- const wrappedComponent = (children: React.ReactElement) => (
12
- <QueryClientProvider client={new QueryClient()}>
13
- {children}
14
- </QueryClientProvider>
15
- );
16
-
17
- test('renders PlayerPreview component with right information', () => {
18
- render(wrappedComponent(<PlayerPreview {...DEFAULT_MODAL_COMP} />));
19
- expect(screen.getByText('getURL')).toBeInTheDocument();
20
- expect(screen.getByText('previewButton')).toBeInTheDocument();
21
- expect(screen.getByRole('tab', { name: /javascript/i })).toBeInTheDocument();
22
- expect(screen.getByRole('tab', { name: /IFrame/i })).toBeInTheDocument();
23
- });
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import { act, fireEvent, render } from '@testing-library/react';
3
- import { TabsHeader } from '../src/js/components';
4
-
5
- const DEFAULT_MODAL_COMP = {
6
- currentTab: 'iframe',
7
- handleTabChange: jest.fn(),
8
- iframeLabel: 'iframe',
9
- jsLabel: 'js',
10
- };
11
-
12
- test('renders TabsHeader clickeable tabs', async () => {
13
- const { getByRole } = render(<TabsHeader {...DEFAULT_MODAL_COMP} />);
14
- const jsBtn = getByRole('tab', { name: DEFAULT_MODAL_COMP.jsLabel });
15
- act(() => {
16
- fireEvent.click(jsBtn);
17
- });
18
- expect(DEFAULT_MODAL_COMP.handleTabChange).toBeCalled();
19
- });
@@ -1,46 +0,0 @@
1
- import React from 'react';
2
- import { act, fireEvent, render } from '@testing-library/react';
3
- import { TabsSection } from 'js/components';
4
-
5
- const DEFAULT_MODAL_COMP = {
6
- playerId: 'default',
7
- videoId: '1234',
8
- accountId: 'default',
9
- isBcMapTracking: false,
10
- };
11
-
12
- test('renders TabsSection clickeable tabs', async () => {
13
- const { getByRole, getByText } = render(
14
- <TabsSection {...DEFAULT_MODAL_COMP} isCampaign isViewerIdSource={false} />,
15
- );
16
- const jsBtn = getByRole('tab', { name: /javascript/i });
17
- act(() => {
18
- fireEvent.click(jsBtn);
19
- });
20
- expect(getByText(/data-video-id/i)).toBeInTheDocument();
21
- });
22
-
23
- test('renders helper text for campaign players', async () => {
24
- const { getByText } = render(
25
- <TabsSection {...DEFAULT_MODAL_COMP} isCampaign isViewerIdSource={false} />,
26
- );
27
- expect(getByText('tabs.helperTextWarning')).toBeInTheDocument();
28
- });
29
-
30
- test('renders helper text for viewer id source players', async () => {
31
- const { getByText } = render(
32
- <TabsSection {...DEFAULT_MODAL_COMP} isCampaign={false} isViewerIdSource />,
33
- );
34
- expect(getByText('tabs.viewerIdTextWarning')).toBeInTheDocument();
35
- });
36
-
37
- test('renders iframe content if it is not campaign or viewer id', async () => {
38
- const { getByText } = render(
39
- <TabsSection
40
- {...DEFAULT_MODAL_COMP}
41
- isCampaign={false}
42
- isViewerIdSource={false}
43
- />,
44
- );
45
- expect(getByText(/allowfullscreen/i)).toBeInTheDocument();
46
- });
@@ -1,45 +0,0 @@
1
- import React from 'react';
2
- import { render, screen } from '@testing-library/react';
3
- import { TitleWithTooltip } from '../src/js/components';
4
- import { truncateVideoTitle } from '../src/js/utils/util';
5
-
6
- const DEFAULT_VIDEO_COMP = {
7
- videoId: '123',
8
- videoName:
9
- 'The cat is a domestic species of small carnivorous mammal. It is the only domesticated species in the family Felidae and is often referred to as the domestic cat to distinguish it from the wild members of the family. ',
10
- accountId: '456',
11
- duration: 10,
12
- };
13
-
14
- const DEFAULT_PROJECT_COMP = {
15
- videoId: '456',
16
- interactivityProjectId: '987',
17
- interactivityProjectName:
18
- "The dog is a domesticated descendant of the wolf. Also called the domestic dog, it is derived from the extinct Pleistocene wolf, and the modern wolf is the dog's nearest living relative. ",
19
- accountId: '456',
20
- duration: 10,
21
- };
22
-
23
- test('renders TitleWithTooltip for Video with truncated title if its too long', () => {
24
- const truncatedTitle = truncateVideoTitle(DEFAULT_VIDEO_COMP.videoName);
25
- render(
26
- <TitleWithTooltip
27
- name={DEFAULT_VIDEO_COMP.videoName}
28
- id={DEFAULT_VIDEO_COMP.videoId}
29
- />,
30
- );
31
- expect(screen.getByText(truncatedTitle)).toBeInTheDocument();
32
- });
33
-
34
- test('renders TitleWithTooltip for Project with truncated title if its too long', () => {
35
- const truncatedTitle = truncateVideoTitle(
36
- DEFAULT_PROJECT_COMP.interactivityProjectName,
37
- );
38
- render(
39
- <TitleWithTooltip
40
- name={DEFAULT_PROJECT_COMP.interactivityProjectName}
41
- id={DEFAULT_PROJECT_COMP.videoId}
42
- />,
43
- );
44
- expect(screen.getByText(truncatedTitle)).toBeInTheDocument();
45
- });
@@ -1,38 +0,0 @@
1
- import React from 'react';
2
- import { QueryClientProvider, QueryClient } from 'react-query';
3
- import { render, screen } from '@testing-library/react';
4
- import { VideoPlayer } from '../src/js/components/VideoPlayer';
5
- import { EmbedCodeModalTypes } from '../src/js/types/EmbedCodeModalProps';
6
- import { PLAYER_LIST_FOR_SELECTION, PLAYERS } from '../src/js/constants/player';
7
-
8
- jest.mock('../src/js/utils/featureSwitches');
9
-
10
- const wrappedComponent = (children: React.ReactElement) => (
11
- <QueryClientProvider client={new QueryClient()}>
12
- {children}
13
- </QueryClientProvider>
14
- );
15
-
16
- const DEFAULT_MODAL_COMP = {
17
- videoId: '123',
18
- videoName: 'test video',
19
- accountId: '456',
20
- duration: 10,
21
- };
22
-
23
- test('renders EmbedCodeModal component with right information', () => {
24
- render(
25
- wrappedComponent(
26
- <VideoPlayer
27
- video={DEFAULT_MODAL_COMP}
28
- embedCodeModalType={EmbedCodeModalTypes.VIDEO}
29
- playerListForSelection={PLAYER_LIST_FOR_SELECTION}
30
- players={PLAYERS}
31
- />,
32
- ),
33
- );
34
- expect(screen.getByText(DEFAULT_MODAL_COMP.videoId)).toBeInTheDocument();
35
- expect(screen.getByText(DEFAULT_MODAL_COMP.videoName)).toBeInTheDocument();
36
- expect(screen.getByRole('tab', { name: /javascript/i })).toBeInTheDocument();
37
- expect(screen.getByRole('tab', { name: /IFrame/i })).toBeInTheDocument();
38
- });
@@ -1,89 +0,0 @@
1
- import {
2
- getVideoPreviewLink,
3
- sortAsc,
4
- truncateVideoTitle,
5
- } from '../src/js/utils/util';
6
-
7
- test('sorting working as expected', () => {
8
- const data = [
9
- { value: '6B9lFzOYe', label: '#1212' },
10
- { value: 'BKCEJEm0L', label: 'other 2' },
11
- { value: 'WbMYTw0lh', label: '&^qwe' },
12
- { value: 'ZLJg8MzKS', label: '123' },
13
- { value: 'default', label: 'Brightcove' },
14
- ];
15
- const expected = [
16
- { value: 'WbMYTw0lh', label: '&^qwe' },
17
- { value: '6B9lFzOYe', label: '#1212' },
18
- { value: 'ZLJg8MzKS', label: '123' },
19
- { value: 'default', label: 'Brightcove' },
20
- { value: 'BKCEJEm0L', label: 'other 2' },
21
- ];
22
- expect(sortAsc(data)).toEqual(expected);
23
- });
24
-
25
- test('video preview url created correctly', () => {
26
- const video = {
27
- videoId: 'test',
28
- videoName: 'test',
29
- accountId: 'test',
30
- posterUrl: 'test',
31
- duration: 10,
32
- };
33
- const expected =
34
- 'https://players.qa.brightcove.net/test/default_default/index.html?videoId=test';
35
- expect(
36
- getVideoPreviewLink({
37
- accountId: video.accountId,
38
- videoId: video.videoId,
39
- playerId: 'default',
40
- }),
41
- ).toBe(expected);
42
- });
43
-
44
- test('interactivity project preview url created correctly', () => {
45
- const video = {
46
- interactivityProjectId: 'test',
47
- accountId: 'test',
48
- posterUrl: 'test',
49
- duration: 10,
50
- };
51
- const expected =
52
- 'https://players.qa.brightcove.net/test/default_default/index.html?interactivityProjectId=test';
53
- expect(
54
- getVideoPreviewLink({
55
- accountId: video.accountId,
56
- interactivityProjectId: video.interactivityProjectId,
57
- playerId: 'default',
58
- }),
59
- ).toBe(expected);
60
- });
61
-
62
- test('long video titles are truncated properly', () => {
63
- const video = {
64
- videoId: 'test',
65
- videoName:
66
- 'The cat is a domestic species of small carnivorous mammal. It is the only domesticated species in the family Felidae and is often referred to as the domestic cat to distinguish it from the wild members of the family. ',
67
- accountId: 'test',
68
- posterUrl: 'test',
69
- duration: 10,
70
- };
71
- const expected =
72
- 'The cat is a domestic species of small carnivorous mammal. I...';
73
- const truncatedTitle = truncateVideoTitle(video.videoName);
74
-
75
- expect(expected).toEqual(truncatedTitle);
76
- });
77
-
78
- test('short video titles are truncated properly', () => {
79
- const video = {
80
- videoId: 'test',
81
- videoName: 'This is a normal video title',
82
- accountId: 'test',
83
- posterUrl: 'test',
84
- duration: 10,
85
- };
86
- const truncatedTitle = truncateVideoTitle(video.videoName);
87
-
88
- expect(video.videoName).toEqual(truncatedTitle);
89
- });
package/babel.config.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "presets": [
3
- [
4
- "@babel/preset-env",
5
- {
6
- "useBuiltIns": "entry",
7
- "corejs": 3
8
- }
9
- ],
10
- "@babel/preset-typescript",
11
- "@babel/preset-react"
12
- ],
13
- "plugins": [
14
- "@babel/proposal-class-properties",
15
- "@babel/plugin-transform-runtime"
16
- ]
17
- }
@@ -1,27 +0,0 @@
1
- -----BEGIN RSA PRIVATE KEY-----
2
- MIIEpAIBAAKCAQEAxXmI7sOBKvFm8TFIhKoYCYOaDE+upc6TcPqNlTt8wA8bBpUY
3
- Je99ofu5CBNsD0uI1XTWy+Bjmo177ND+3apni6KZkOh8kSb/5OAL+eEbqHksL8Z6
4
- +bAlKtOjjyv3Se/T8sEIo1dszgBFVdPbQZVrYLzGu9g6tLcu1jJ9mjdCLthEdSJH
5
- tPkTFUYp8Wlup9qMmvG1jo2wqz4pFVtHyZW/fCkQ+MkfeOPnGiSw2oEnHaVmGuPF
6
- eyxhWBh2q2MAqpyc9qVMkDQowQxtg//zOVlr632XZpI2xhpuINHUztDxEHOB3Hd5
7
- lT+v3WQttQZ/1gRXaJkFAGKxgbLfuLh92L975QIDAQABAoIBAFKdh/YsAKwQlnqt
8
- naMy7h982UPxSiXACNspV3ZpjsVjDHFyisnEKhFMmJqSVZEIjtSOrxZYaBNOwdvP
9
- i/D8y5kVi52eRg8L+96rBRejX8jZ+Ox74xL26HXEWRca07gxB8D1lUGQ38pHPrqr
10
- iX0kn+m20IXh7p2QTZ37PaT5HU0vHIs6K0wOWelPxjtU93FIsiwfaOOba3FOLEXa
11
- Sd5GvRu9pCpSPO45zTsMI6w1MlD38KUJDcBf2Tm/gSMgfDvj1gPvynXBedlWDXsL
12
- TIckV0YO0gmRiWanoXc0lafE3Fb0ctcRrGBBlpjhGxkXxYNY5A6b8CE9eJQWtUg8
13
- 7Xo14kECgYEA9V3uqpE0TuArzNzy8jth0meH/gGmIWknQSCSX2wj6b4yvArOWrsS
14
- qyq1Wd0JfE8AOZf4uWuiJKRk0uRE+xkpYk4tH+7/0+R315a1SXiQb020R6iMC406
15
- wrRSz0R+xFF8zyD4AKKxSO8CgMotcU/oH78lGObWwTuxQlptXjcC8/kCgYEAzghL
16
- EDS6TzM9EFt8rbOi6quoahTsDNoPm8kG1TNKxmM805N7dQS3E72/6Sp2ndiTysgu
17
- rS8j0JC8yBx6oaQMcvY/dUZ3/ZdR6Y6SDqmaTFmbcpWGQzKW89VP5kIffi80dF3A
18
- FtXt94mG2vcbxdWxyC8CIrDwevfmczs0C5pPak0CgYBHJHcg6X0bKZBJk/61EVap
19
- pO8fTOcYZN7G2WTXWgmHqmgXcaKnV/pvurBeX+JyMo3EJTYuvPCEY04Af8MocwE2
20
- yaf3zFpM27+LuNzTcqueOg99f3crmkVhUtt30UpYLbBcdhiyRnnUxcgaA4Tth9er
21
- 7MYa1EOMP3yD2qg/Wv/2MQKBgQCnRrJzCOxPC0HDuxOiD9vw/cexwSTZVl4f1HoY
22
- tRk7syyadv5gRqDBhWh/zXsastFjbV4AO+qvFiQ/sGecPw3gdK+W7szS9n2Jy7gn
23
- 8WmWHZaI1H96pWNLut+xCfR5xaen5snjgHNBa8YylzhUSiiaaBgqxE+q9wSCgAnE
24
- ddeObQKBgQCpy2Vq/aUUNMVNDV3vmEwYRD8qsqe5JWXswyOM+ZyHg3N06auP2RHx
25
- NqUE9gdDxR1gc6cUhxbR9+L9DMEWiLVqXY51yddMCVuQVTHyH4MhyJcXv1eEbtX2
26
- T/5dnQPy5ib85HAvAei6bf+uRKjm86984JfYZIwEwbGS+H9irF/3Pw==
27
- -----END RSA PRIVATE KEY-----
@@ -1,96 +0,0 @@
1
- Certificate:
2
- Data:
3
- Version: 3 (0x2)
4
- Serial Number: 4109 (0x100d)
5
- Signature Algorithm: sha256WithRSAEncryption
6
- Issuer: C=US, ST=Massachusetts, L=Boston, O=Brightcove Inc., OU=Systems Engineering/emailAddress=syseng@brightcove.com
7
- Validity
8
- Not Before: Jan 22 15:49:19 2016 GMT
9
- Not After : Jan 19 15:49:19 2026 GMT
10
- Subject: C=US, ST=Massachusetts, O=Brightcove Inc., OU=Systems Engineering, CN=*.brightcove.com/emailAddress=syseng@brightcove.com
11
- Subject Public Key Info:
12
- Public Key Algorithm: rsaEncryption
13
- RSA Public Key: (2048 bit)
14
- Modulus (2048 bit):
15
- 00:c5:79:88:ee:c3:81:2a:f1:66:f1:31:48:84:aa:
16
- 18:09:83:9a:0c:4f:ae:a5:ce:93:70:fa:8d:95:3b:
17
- 7c:c0:0f:1b:06:95:18:25:ef:7d:a1:fb:b9:08:13:
18
- 6c:0f:4b:88:d5:74:d6:cb:e0:63:9a:8d:7b:ec:d0:
19
- fe:dd:aa:67:8b:a2:99:90:e8:7c:91:26:ff:e4:e0:
20
- 0b:f9:e1:1b:a8:79:2c:2f:c6:7a:f9:b0:25:2a:d3:
21
- a3:8f:2b:f7:49:ef:d3:f2:c1:08:a3:57:6c:ce:00:
22
- 45:55:d3:db:41:95:6b:60:bc:c6:bb:d8:3a:b4:b7:
23
- 2e:d6:32:7d:9a:37:42:2e:d8:44:75:22:47:b4:f9:
24
- 13:15:46:29:f1:69:6e:a7:da:8c:9a:f1:b5:8e:8d:
25
- b0:ab:3e:29:15:5b:47:c9:95:bf:7c:29:10:f8:c9:
26
- 1f:78:e3:e7:1a:24:b0:da:81:27:1d:a5:66:1a:e3:
27
- c5:7b:2c:61:58:18:76:ab:63:00:aa:9c:9c:f6:a5:
28
- 4c:90:34:28:c1:0c:6d:83:ff:f3:39:59:6b:eb:7d:
29
- 97:66:92:36:c6:1a:6e:20:d1:d4:ce:d0:f1:10:73:
30
- 81:dc:77:79:95:3f:af:dd:64:2d:b5:06:7f:d6:04:
31
- 57:68:99:05:00:62:b1:81:b2:df:b8:b8:7d:d8:bf:
32
- 7b:e5
33
- Exponent: 65537 (0x10001)
34
- X509v3 extensions:
35
- X509v3 Basic Constraints:
36
- CA:FALSE
37
- Netscape Comment:
38
- OpenSSL Generated Certificate
39
- X509v3 Subject Key Identifier:
40
- 25:8C:64:B3:F5:49:BD:8A:1F:42:9A:D6:69:9C:B4:04:FE:4B:82:C2
41
- X509v3 Authority Key Identifier:
42
- keyid:D1:E0:AC:DE:01:80:DB:94:DA:29:66:0F:A9:48:11:BF:62:9F:51:9E
43
- DirName:/C=US/ST=Massachusetts/L=Boston/O=Brightcove Inc./OU=Systems Engineering/emailAddress=syseng@brightcove.com
44
- serial:C2:3B:9A:77:9C:63:DE:2B
45
-
46
- X509v3 Subject Alternative Name:
47
- DNS:*.brightcove.com, DNS:*.qa.brightcove.com, DNS:*.oauth.qa.brightcove.com, DNS:*.staging.brightcove.com
48
- X509v3 Key Usage:
49
- Digital Signature, Non Repudiation, Key Encipherment
50
- Signature Algorithm: sha256WithRSAEncryption
51
- a7:58:ec:1b:a5:c3:29:1d:71:c1:dd:b0:8c:ac:1d:34:b3:24:
52
- 56:53:43:37:49:20:21:13:b3:1c:bc:d9:a3:e3:56:49:15:56:
53
- 40:51:6f:cf:9e:c1:c2:ad:08:67:b1:bd:a6:11:3b:35:65:06:
54
- b3:ff:de:36:93:86:10:45:e9:36:0a:5b:26:f0:23:82:8f:83:
55
- 9f:1d:3f:be:ab:54:b3:f6:6c:7d:7b:67:6f:27:f7:f9:fa:30:
56
- 27:1e:70:e4:05:85:ac:ad:d8:a5:45:83:54:68:0a:1d:fa:c2:
57
- 05:46:41:d3:ad:a9:97:db:7a:fa:77:e1:0f:b0:29:09:da:15:
58
- 2c:f1:d4:0f:a4:ce:90:fe:54:23:20:5c:68:3d:3a:06:0e:83:
59
- ab:3a:3e:43:84:2f:71:5f:d9:c8:29:d1:35:51:c2:c2:57:75:
60
- 8b:10:1e:cd:c0:8b:ca:b1:31:bb:5c:cf:03:52:05:f1:a8:0e:
61
- bc:ca:ff:1a:7d:cf:22:fb:85:13:22:96:cb:dd:2b:00:68:5c:
62
- ce:cd:d6:e7:5d:f1:fe:9e:60:07:7e:df:2d:d5:99:74:b3:90:
63
- 33:55:da:18:7c:83:31:80:59:b1:a5:53:2f:5c:f2:86:d1:6f:
64
- eb:fe:68:5d:a3:0b:52:36:d8:77:40:24:fc:ed:5c:72:7a:23:
65
- e5:2f:bb:6b
66
- -----BEGIN CERTIFICATE-----
67
- MIIFTjCCBDagAwIBAgICEA0wDQYJKoZIhvcNAQELBQAwgZQxCzAJBgNVBAYTAlVT
68
- MRYwFAYDVQQIEw1NYXNzYWNodXNldHRzMQ8wDQYDVQQHEwZCb3N0b24xGDAWBgNV
69
- BAoTD0JyaWdodGNvdmUgSW5jLjEcMBoGA1UECxMTU3lzdGVtcyBFbmdpbmVlcmlu
70
- ZzEkMCIGCSqGSIb3DQEJARYVc3lzZW5nQGJyaWdodGNvdmUuY29tMB4XDTE2MDEy
71
- MjE1NDkxOVoXDTI2MDExOTE1NDkxOVowgZ4xCzAJBgNVBAYTAlVTMRYwFAYDVQQI
72
- Ew1NYXNzYWNodXNldHRzMRgwFgYDVQQKEw9CcmlnaHRjb3ZlIEluYy4xHDAaBgNV
73
- BAsTE1N5c3RlbXMgRW5naW5lZXJpbmcxGTAXBgNVBAMUECouYnJpZ2h0Y292ZS5j
74
- b20xJDAiBgkqhkiG9w0BCQEWFXN5c2VuZ0BicmlnaHRjb3ZlLmNvbTCCASIwDQYJ
75
- KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMV5iO7DgSrxZvExSISqGAmDmgxPrqXO
76
- k3D6jZU7fMAPGwaVGCXvfaH7uQgTbA9LiNV01svgY5qNe+zQ/t2qZ4uimZDofJEm
77
- /+TgC/nhG6h5LC/GevmwJSrTo48r90nv0/LBCKNXbM4ARVXT20GVa2C8xrvYOrS3
78
- LtYyfZo3Qi7YRHUiR7T5ExVGKfFpbqfajJrxtY6NsKs+KRVbR8mVv3wpEPjJH3jj
79
- 5xoksNqBJx2lZhrjxXssYVgYdqtjAKqcnPalTJA0KMEMbYP/8zlZa+t9l2aSNsYa
80
- biDR1M7Q8RBzgdx3eZU/r91kLbUGf9YEV2iZBQBisYGy37i4fdi/e+UCAwEAAaOC
81
- AZwwggGYMAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJh
82
- dGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBQljGSz9Um9ih9CmtZpnLQE/kuCwjCB
83
- yQYDVR0jBIHBMIG+gBTR4KzeAYDblNopZg+pSBG/Yp9RnqGBmqSBlzCBlDELMAkG
84
- A1UEBhMCVVMxFjAUBgNVBAgTDU1hc3NhY2h1c2V0dHMxDzANBgNVBAcTBkJvc3Rv
85
- bjEYMBYGA1UEChMPQnJpZ2h0Y292ZSBJbmMuMRwwGgYDVQQLExNTeXN0ZW1zIEVu
86
- Z2luZWVyaW5nMSQwIgYJKoZIhvcNAQkBFhVzeXNlbmdAYnJpZ2h0Y292ZS5jb22C
87
- CQDCO5p3nGPeKzBlBgNVHREEXjBcghAqLmJyaWdodGNvdmUuY29tghMqLnFhLmJy
88
- aWdodGNvdmUuY29tghkqLm9hdXRoLnFhLmJyaWdodGNvdmUuY29tghgqLnN0YWdp
89
- bmcuYnJpZ2h0Y292ZS5jb20wCwYDVR0PBAQDAgXgMA0GCSqGSIb3DQEBCwUAA4IB
90
- AQCnWOwbpcMpHXHB3bCMrB00syRWU0M3SSAhE7McvNmj41ZJFVZAUW/PnsHCrQhn
91
- sb2mETs1ZQaz/942k4YQRek2Clsm8COCj4OfHT++q1Sz9mx9e2dvJ/f5+jAnHnDk
92
- BYWsrdilRYNUaAod+sIFRkHTramX23r6d+EPsCkJ2hUs8dQPpM6Q/lQjIFxoPToG
93
- DoOrOj5DhC9xX9nIKdE1UcLCV3WLEB7NwIvKsTG7XM8DUgXxqA68yv8afc8i+4UT
94
- IpbL3SsAaFzOzdbnXfH+nmAHft8t1Zl0s5AzVdoYfIMxgFmxpVMvXPKG0W/r/mhd
95
- owtSNth3QCT87VxyeiPlL7tr
96
- -----END CERTIFICATE-----
@@ -1,62 +0,0 @@
1
- import '@testing-library/jest-dom';
2
- import 'jest-canvas-mock';
3
- import ResizeObserver from 'resize-observer-polyfill';
4
-
5
- // eslint-disable-next-line no-undef
6
- jest.mock('js/hooks/useGetPlayers', () => {
7
- // eslint-disable-next-line no-undef
8
- return jest.fn().mockReturnValue({
9
- isLoading: false,
10
- data: {
11
- items: [
12
- {
13
- account_id: 'test',
14
- id: 'default',
15
- name: 'default',
16
- description: 'test',
17
- branches: { master: { configuration: {} } },
18
- created_at: 'test',
19
- embed_count: 2,
20
- url: 'test',
21
- },
22
- ],
23
- },
24
- });
25
- });
26
-
27
- // eslint-disable-next-line no-undef
28
- jest.mock('react-i18next', () => ({
29
- useTranslation: () => {
30
- return {
31
- t: (str) => str,
32
- i18n: {
33
- changeLanguage: () =>
34
- new Promise(() => {
35
- return;
36
- }),
37
- },
38
- };
39
- },
40
- initReactI18next: {
41
- type: '3rdParty',
42
- init: () => {
43
- return;
44
- },
45
- },
46
- Trans: () => '<div/>',
47
- }));
48
-
49
- global.StudioModule = {
50
- config: {
51
- product: {
52
- env: 'qa',
53
- },
54
- },
55
- getCurrentUserAccount: () => {
56
- return {
57
- roles: [],
58
- };
59
- },
60
- };
61
-
62
- global.ResizeObserver = ResizeObserver;
package/jest/jest.stub.js DELETED
@@ -1,4 +0,0 @@
1
- // stub out modules that you want to load for tests here
2
- module.exports = {
3
- process: () => '',
4
- };
package/jest.config.js DELETED
@@ -1,24 +0,0 @@
1
- module.exports = {
2
- transform: {
3
- '\\.(css|sass)$': '<rootDir>/jest/jest.stub.js',
4
- '^.+\\.(t|j)sx?$': 'babel-jest',
5
- },
6
- moduleNameMapper: {
7
- '^js/(.*)$': '<rootDir>/src/js/$1',
8
- '^styles/(.*)$': '<rootDir>/src/styles/$1',
9
- '^mocks/(.*)$': '<rootDir>/__mocks__/$1',
10
- '^translations/(.*)$': '<rootDir>/src/translations/$1',
11
- '\\.(css|sass)$': '<rootDir>/jest/jest.stub.js',
12
- },
13
- testPathIgnorePatterns : [
14
- './build/',
15
- ],
16
- setupFilesAfterEnv: ['<rootDir>/jest/jest.setup.js'],
17
- coveragePathIgnorePatterns: [
18
- '/node_modules/',
19
- '/jest/',
20
- '/locales/',
21
- '/styles/',
22
- ],
23
- testEnvironment: 'jest-environment-jsdom',
24
- };