function testAddAndCopyItems() {
  var rootBlock = editor.questionnaire_.getRootBlock();
  var rootBlockChildren = rootBlock.getContainerItems();
  var firstChild = rootBlockChildren[0];
  assertNotEquals(firstChild.type, rootBlockChildren[1].type);
  // Insert the same item type below the existing item.
  editor.setEditability(firstChild, true);
  editor.addItem(firstChild.container.firstChild);
  editor.setEditability(firstChild, false);
  assertEquals(firstChild.type, rootBlockChildren[1].type);
  assertNotEquals(firstChild.text, rootBlockChildren[1].text);
  // Now copy the first child and insert it below it.
  editor.copyItem(firstChild.container.firstChild);
  assertEquals(firstChild.type, rootBlockChildren[1].type);
  assertEquals(firstChild.text, rootBlockChildren[1].text);
}
/**
 * Tests whether items are correctly addable and copyable.
 */
Tests whether items are correctly addable and copyable.
Tests whether items are correctly addable and copyable .
function testAddAndCopyItems() {
  var rootBlock = editor.questionnaire_.getRootBlock();
  var rootBlockChildren = rootBlock.getContainerItems();
  var firstChild = rootBlockChildren[0];
  assertNotEquals(firstChild.type, rootBlockChildren[1].type);
  editor.setEditability(firstChild, true);
  editor.addItem(firstChild.container.firstChild);
  editor.setEditability(firstChild, false);
  assertEquals(firstChild.type, rootBlockChildren[1].type);
  assertNotEquals(firstChild.text, rootBlockChildren[1].text);
  editor.copyItem(firstChild.container.firstChild);
  assertEquals(firstChild.type, rootBlockChildren[1].type);
  assertEquals(firstChild.text, rootBlockChildren[1].text);
}
function testAddAndCopyItems ( ) { var rootBlock = editor . questionnaire_ . getRootBlock ( ) ; var rootBlockChildren = rootBlock . getContainerItems ( ) ; var firstChild = rootBlockChildren [ 0 ] ; assertNotEquals ( firstChild . type , rootBlockChildren [ 1 ] . type ) ; editor . setEditability ( firstChild , true ) ; editor . addItem ( firstChild . container . firstChild ) ; editor . setEditability ( firstChild , false ) ; assertEquals ( firstChild . type , rootBlockChildren [ 1 ] . type ) ; assertNotEquals ( firstChild . text , rootBlockChildren [ 1 ] . text ) ; editor . copyItem ( firstChild . container . firstChild ) ; assertEquals ( firstChild . type , rootBlockChildren [ 1 ] . type ) ; assertEquals ( firstChild . text , rootBlockChildren [ 1 ] . text ) ; }
Tests whether items are correctly addable and copyable.
Tests whether items are correctly addable and copyable .
// Insert the same item type below the existing item. // Now copy the first child and insert it below it.