diff --git a/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/__snapshots__/index.test.jsx.snap b/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/__snapshots__/index.test.jsx.snap index 0fcfc6ed0..8ae716816 100644 --- a/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/__snapshots__/index.test.jsx.snap +++ b/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/__snapshots__/index.test.jsx.snap @@ -1,5 +1,188 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`SettingsWidget isLibrary snapshot: renders Settings widget for Advanced Problem with correct widgets 1`] = ` +
+
+ +
+
+ +
+ +
+ + + + + +
+ + +
+ +
+ +
+
+`; + +exports[`SettingsWidget isLibrary snapshot: renders Settings widget page 1`] = ` +
+
+ +
+
+ +
+ +
+ + + + + +
+ + +
+ +
+ +
+
+`; + +exports[`SettingsWidget isLibrary snapshot: renders Settings widget page advanced settings visible 1`] = ` +
+
+ +
+
+ +
+ +
+ + + + + +
+ + +
+ +
+ +
+
+`; + exports[`SettingsWidget snapshot snapshot: renders Settings widget for Advanced Problem with correct widgets 1`] = `
)} -
- -
+ {!isLibrary && ( +
+ +
+ )}
- -
- -
-
- -
+ {!isLibrary && ( +
+ +
+ )} + {!isLibrary && ( +
+ +
+ )} { problemType === ProblemTypeKeys.ADVANCED && (
@@ -142,9 +147,11 @@ const SettingsWidget = ({
) } -
- -
+ {!isLibrary && ( +
+ +
+ )}
diff --git a/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/index.test.jsx b/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/index.test.jsx index 1630753c0..db7834492 100644 --- a/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/index.test.jsx +++ b/src/editors/containers/ProblemEditor/components/EditProblemView/SettingsWidget/index.test.jsx @@ -74,6 +74,39 @@ describe('SettingsWidget', () => { }); }); + describe('isLibrary', () => { + const libraryProps = { + ...props, + isLibrary: true, + }; + test('snapshot: renders Settings widget page', () => { + const showAdvancedSettingsCardsProps = { + isAdvancedCardsVisible: false, + setResetTrue: jest.fn().mockName('showAdvancedSettingsCards.setResetTrue'), + }; + showAdvancedSettingsCards.mockReturnValue(showAdvancedSettingsCardsProps); + expect(shallow().snapshot).toMatchSnapshot(); + }); + test('snapshot: renders Settings widget page advanced settings visible', () => { + const showAdvancedSettingsCardsProps = { + isAdvancedCardsVisible: true, + setResetTrue: jest.fn().mockName('showAdvancedSettingsCards.setResetTrue'), + }; + showAdvancedSettingsCards.mockReturnValue(showAdvancedSettingsCardsProps); + expect(shallow().snapshot).toMatchSnapshot(); + }); + test('snapshot: renders Settings widget for Advanced Problem with correct widgets', () => { + const showAdvancedSettingsCardsProps = { + isAdvancedCardsVisible: true, + setResetTrue: jest.fn().mockName('showAdvancedSettingsCards.setResetTrue'), + }; + showAdvancedSettingsCards.mockReturnValue(showAdvancedSettingsCardsProps); + expect(shallow( + , + ).snapshot).toMatchSnapshot(); + }); + }); + describe('mapDispatchToProps', () => { test('setBlockTitle from actions.app.setBlockTitle', () => { expect(mapDispatchToProps.setBlockTitle).toEqual(actions.app.setBlockTitle);