From 109334a9bf4158bc249e1ee5e59593555d6c8fc5 Mon Sep 17 00:00:00 2001
From: Kristin Aoki <42981026+KristinAoki@users.noreply.github.com>
Date: Tue, 9 May 2023 09:27:32 -0400
Subject: [PATCH] fix: show setting note for course set social share (#327)
---
.../__snapshots__/index.test.jsx.snap | 14 --------------
.../components/SocialShareWidget/index.jsx | 16 ++++++++--------
.../components/SocialShareWidget/index.test.jsx | 16 ++++++++++++----
3 files changed, 20 insertions(+), 26 deletions(-)
diff --git a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/__snapshots__/index.test.jsx.snap b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/__snapshots__/index.test.jsx.snap
index 3e905c6d5..701f3f788 100644
--- a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/__snapshots__/index.test.jsx.snap
+++ b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/__snapshots__/index.test.jsx.snap
@@ -31,13 +31,6 @@ exports[`SocialShareWidget rendered with videoSharingEnabled true and allowVideo
This video is shareable to social media
-
-
-
@@ -77,13 +70,6 @@ exports[`SocialShareWidget rendered with videoSharingEnabled true and allowVideo
This video is shareable to social media
-
-
-
diff --git a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/index.jsx b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/index.jsx
index f9c9a2026..e29943025 100644
--- a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/index.jsx
+++ b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/index.jsx
@@ -63,15 +63,15 @@ export const SocialShareWidget = ({
{intl.formatMessage(messages.socialSharingCheckboxLabel)}
- {!isLibrary && (
-
-
-
- )}
{isSetByCourse && (
-
-
-
+ <>
+
+
+
+
+
+
+ >
)}
diff --git a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/index.test.jsx b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/index.test.jsx
index 41e29a8f2..fe6ca24e2 100644
--- a/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/index.test.jsx
+++ b/src/editors/containers/VideoEditor/components/VideoSettingsModal/components/SocialShareWidget/index.test.jsx
@@ -101,9 +101,13 @@ describe('SocialShareWidget', () => {
/>);
it('should not have setting location message', () => {
const formattedMessages = wrapper.find('FormattedMessage');
- expect(formattedMessages.length).toEqual(2);
+ expect(formattedMessages.length).toEqual(1);
expect(formattedMessages.at(0)).not.toEqual(messages.disclaimerSettingLocation.defaultMessage);
- expect(formattedMessages.at(1)).not.toEqual(messages.disclaimerSettingLocation.defaultMessage);
+ });
+ it('should not have override note', () => {
+ const formattedMessages = wrapper.find('FormattedMessage');
+ expect(formattedMessages.length).toEqual(1);
+ expect(formattedMessages.at(0)).not.toEqual(messages.overrideSocialSharingNote.defaultMessage);
});
it('should have checkbox disabled prop equal false', () => {
const disabledCheckbox = wrapper.children().at(1).prop('disabled');
@@ -179,9 +183,13 @@ describe('SocialShareWidget', () => {
/>);
it('should not have setting location message', () => {
const formattedMessages = wrapper.find('FormattedMessage');
- expect(formattedMessages.length).toEqual(2);
+ expect(formattedMessages.length).toEqual(1);
expect(formattedMessages.at(0)).not.toEqual(messages.disclaimerSettingLocation.defaultMessage);
- expect(formattedMessages.at(1)).not.toEqual(messages.disclaimerSettingLocation.defaultMessage);
+ });
+ it('should not have override note', () => {
+ const formattedMessages = wrapper.find('FormattedMessage');
+ expect(formattedMessages.length).toEqual(1);
+ expect(formattedMessages.at(0)).not.toEqual(messages.overrideSocialSharingNote.defaultMessage);
});
it('should have checkbox disabled prop equal false', () => {
const disabledCheckbox = wrapper.children().at(1).prop('disabled');