function testParseTemplate() {
  var templateBackup = editor.editTemplateElementDecorator_.getValue();
  // The template was already exported and should be parsable.
  assertTrue(editor.parseTemplate());
  editor.exportTemplate();
  // We want the template to keep its exact form after being parsed and
  // exported again.
  var currentTemplate = editor.editTemplateElementDecorator_.getValue();
  assertEquals(templateBackup, currentTemplate);
  // Test against invalid templates.
  editor.editTemplateElementDecorator_.setValue(INVALID_JSON);
  assertFalse(editor.parseTemplate());
  // Test if the currently displayed questionnaire has been exported and a valid
  // template has been restored. This should happen once an error during parsing
  // occurs.
  assertTrue(editor.parseTemplate());
}
/**
 * Tests whether the questionnaire editor is reacting correctly to faulty
 * templates and is able to parse valid ones.
 */
Tests whether the questionnaire editor is reacting correctly to faulty
templates and is able to parse valid ones.
Tests whether the questionnaire editor is reacting correctly to faulty templates and is able to parse valid ones .
function testParseTemplate() {
  var templateBackup = editor.editTemplateElementDecorator_.getValue();
  assertTrue(editor.parseTemplate());
  editor.exportTemplate();
  var currentTemplate = editor.editTemplateElementDecorator_.getValue();
  assertEquals(templateBackup, currentTemplate);
  editor.editTemplateElementDecorator_.setValue(INVALID_JSON);
  assertFalse(editor.parseTemplate());
  assertTrue(editor.parseTemplate());
}
function testParseTemplate ( ) { var templateBackup = editor . editTemplateElementDecorator_ . getValue ( ) ; assertTrue ( editor . parseTemplate ( ) ) ; editor . exportTemplate ( ) ; var currentTemplate = editor . editTemplateElementDecorator_ . getValue ( ) ; assertEquals ( templateBackup , currentTemplate ) ; editor . editTemplateElementDecorator_ . setValue ( INVALID_JSON ) ; assertFalse ( editor . parseTemplate ( ) ) ; assertTrue ( editor . parseTemplate ( ) ) ; }
Tests whether the questionnaire editor is reacting correctly to faulty
 templates and is able to parse valid ones.
Tests whether the questionnaire editor is reacting correctly to faulty templates and is able to parse valid ones .
// The template was already exported and should be parsable. // We want the template to keep its exact form after being parsed and // exported again. // Test against invalid templates. // Test if the currently displayed questionnaire has been exported and a valid // template has been restored. This should happen once an error during parsing // occurs.