Repository: oppia/oppia

Issue:
Ensure all simple editor services are fully unit-tested.
Current services that are not unit-tested (simple-editor branch):

  - [x] ~~SimpleEditorShimService.js~~ (@ashish3805) (#3091)
  - [x] [SimpleEditorManagerService.js](https://github.com/oppia/oppia/blob/simple-editor/core/templates/dev/head/pages/exploration_editor/simple_editor_tab/SimpleEditorManagerService.js) (@ashish3805)
  - [x] [QuestionIdService.js](https://github.com/oppia/oppia/blob/simple-editor/core/templates/dev/head/pages/exploration_editor/simple_editor_tab/QuestionIdService.js)
- [x] [questions/MultipleChoiceInputCheckerService.js](https://github.com/oppia/oppia/blob/simple-editor/core/templates/dev/head/pages/exploration_editor/simple_editor_tab/questions/MultipleChoiceInputCheckerService.js)
- [x] [~~EditorModeService.js~~](https://github.com/oppia/oppia/blob/simple-editor/core/templates/dev/head/pages/exploration_editor/EditorModeService.js) (@95adityajain) (#3127)
- [x] [~~QuestionListObjectFactory~~](https://github.com/oppia/oppia/blob/simple-editor/core/templates/dev/head/domain/exploration/QuestionListObjectFactory.js) (@95adityajain) (#3152)
- [x] [QuestionObjectFactory](https://github.com/oppia/oppia/blob/simple-editor/core/templates/dev/head/domain/exploration/QuestionObjectFactory.js)
- [ ] [StatesToQuestionsService.js](https://github.com/oppia/oppia/blob/simple-editor/core/templates/dev/head/pages/exploration_editor/simple_editor_tab/StatesToQuestionsService.js)
- [ ] [ScrollSyncService.js](https://github.com/oppia/oppia/blob/simple-editor/core/templates/dev/head/pages/exploration_editor/simple_editor_tab/ScrollSyncService.js)



Discussion:
```javascript
/**
 * @fileoverview Unit tests for the SimpleEditorShimService.js
 */
describe('Simple Editor Shim Service', function() {
    var srv = null;
    var memento = 'SampleTitle';

    beforeEach(function() {
        module('oppia');
        module(function($provide) {
            $provide.value('explorationTitleService', {
                savedMemento: memento
            });
        });
    });

    beforeEach(inject(function($injector) {
        srv = $injector.get('SimpleEditorShimService');
    }));

    it('should return title', function() {
        var title = srv.getTitle();
        expect(title).toEqual(memento);
    });
});
```

its my first code in oppia, Please review and let me know if I should commit.
@andromfins I will write unit-tests for questionidservice.js and questions/multiplechoiceinputchecker service.

Resolving patch:
diff --git a/core/controllers/editor.py b/core/controllers/editor.py
--- a/core/controllers/editor.py
+++ b/core/controllers/editor.py
@@ -52,16 +52,7 @@
 # IMPORTANT: Before adding this state to an existing exploration, the
 # state name and the destination of the default rule should first be
 # changed to the desired new state name.
-NEW_STATE_TEMPLATE = {
-    'classifier_model_id': None,
-    'content': [{
-        'type': 'text',
-        'value': ''
-    }],
-    'interaction': exp_domain.State.NULL_INTERACTION_DICT,
-    'param_changes': [],
-    'unresolved_answers': {},
-}
+NEW_STATE_TEMPLATE = constants.NEW_STATE_TEMPLATE
 
 DEFAULT_TWITTER_SHARE_MESSAGE_EDITOR = config_domain.ConfigProperty(
     'default_twitter_share_message_editor', {
diff --git a/core/domain/exp_domain.py b/core/domain/exp_domain.py
--- a/core/domain/exp_domain.py
+++ b/core/domain/exp_domain.py
@@ -1097,19 +1097,6 @@ def get_state_names_required_by_gadgets(self):
 class State(object):
     """Domain object for a state."""
 
-    NULL_INTERACTION_DICT = {
-        'id': None,
-        'customization_args': {},
-        'answer_groups': [],
-        'default_outcome': {
-            'dest': feconf.DEFAULT_INIT_STATE_NAME,
-            'feedback': [],
-            'param_changes': [],
-        },
-        'confirmed_unclassified_answers': [],
-        'fallbacks': [],
-    }
-
     def __init__(self, content, param_changes, interaction,
                  classifier_model_id=None):
         # The content displayed to the reader in this state.


Test patch:
diff --git a/core/domain/exp_domain_test.py b/core/domain/exp_domain_test.py
--- a/core/domain/exp_domain_test.py
+++ b/core/domain/exp_domain_test.py
@@ -18,6 +18,7 @@
 
 import os
 
+from constants import constants
 from core.domain import exp_domain
 from core.domain import exp_services
 from core.domain import param_domain
@@ -2372,3 +2373,13 @@ def test_retrieving_affected_gadgets(self):
 
         self.assertEqual(len(affected_gadget_instances), 1)
         self.assertEqual(affected_gadget_instances[0].name, 'ATestGadget')
+
+
+class StatePropertiesCheck(test_utils.GenericTestBase):
+    """Tests to verify all class variables are correct."""
+
+    def test_state_template_default_outcome_dest_matches_feconf(self):
+        self.assertEqual(
+            feconf.DEFAULT_INIT_STATE_NAME,
+            constants.NEW_STATE_TEMPLATE['interaction']['default_outcome'][
+                'dest'])