fix: show setting note for course set social share (#327)

This commit is contained in:
Kristin Aoki
2023-05-09 09:27:32 -04:00
committed by GitHub
parent 003f33152d
commit 109334a9bf
3 changed files with 20 additions and 26 deletions

View File

@@ -31,13 +31,6 @@ exports[`SocialShareWidget rendered with videoSharingEnabled true and allowVideo
This video is shareable to social media
</div>
</Form.Checkbox>
<div>
<FormattedMessage
defaultMessage="Note: This setting is overridden by the course outline page."
description="Message that the setting can be overriden in the course outline"
id="authoring.videoeditor.socialShare.overrideNote"
/>
</div>
<div
className="mt-3"
>
@@ -77,13 +70,6 @@ exports[`SocialShareWidget rendered with videoSharingEnabled true and allowVideo
This video is shareable to social media
</div>
</Form.Checkbox>
<div>
<FormattedMessage
defaultMessage="Note: This setting is overridden by the course outline page."
description="Message that the setting can be overriden in the course outline"
id="authoring.videoeditor.socialShare.overrideNote"
/>
</div>
<div
className="mt-3"
>

View File

@@ -63,15 +63,15 @@ export const SocialShareWidget = ({
{intl.formatMessage(messages.socialSharingCheckboxLabel)}
</div>
</Form.Checkbox>
{!isLibrary && (
<div>
<FormattedMessage {...messages.overrideSocialSharingNote} />
</div>
)}
{isSetByCourse && (
<div>
<FormattedMessage {...messages.disclaimerSettingLocation} />
</div>
<>
<div className="mt-2">
<FormattedMessage {...messages.overrideSocialSharingNote} />
</div>
<div>
<FormattedMessage {...messages.disclaimerSettingLocation} />
</div>
</>
)}
<div className="mt-3">
<Hyperlink className="text-primary-500" destination={learnMoreLink} target="_blank">

View File

@@ -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');