function testAdminMode() {
  var q = new vsaq.Questionnaire(root);
  var temp = goog.array.clone(QUESTIONNAIRE);
  temp[0].items[2].id = 'block_id2';
  q.setTemplate(temp);
  block = q.items_['block_id2'];

  // No auth parameter set.
  assertTrue(block.isVisible());

  // Auth parameter set, and not in admin mode.
  block.auth = 'admin';
  q.setAdminMode(false);
  q.reevaluateConditions_();
  assertFalse(block.isVisible());

  // Auth parameter set and in admin mode.
  q.setAdminMode(true);
  q.reevaluateConditions_();
  assertTrue(block.isVisible());
}
/**
 * Tests whether items with auth set to 'admin' are visible in admin-mode and
 * invisible otherwise.
 */
Tests whether items with auth set to 'admin' are visible in admin-mode and
invisible otherwise.
Tests whether items with auth set to ' admin ' are visible in admin - mode and invisible otherwise .
function testAdminMode() {
  var q = new vsaq.Questionnaire(root);
  var temp = goog.array.clone(QUESTIONNAIRE);
  temp[0].items[2].id = 'block_id2';
  q.setTemplate(temp);
  block = q.items_['block_id2'];
  assertTrue(block.isVisible());
  block.auth = 'admin';
  q.setAdminMode(false);
  q.reevaluateConditions_();
  assertFalse(block.isVisible());
  q.setAdminMode(true);
  q.reevaluateConditions_();
  assertTrue(block.isVisible());
}
function testAdminMode ( ) { var q = new vsaq . Questionnaire ( root ) ; var temp = goog . array . clone ( QUESTIONNAIRE ) ; temp [ 0 ] . items [ 2 ] . id = 'block_id2' ; q . setTemplate ( temp ) ; block = q . items_ [ 'block_id2' ] ; assertTrue ( block . isVisible ( ) ) ; block . auth = 'admin' ; q . setAdminMode ( false ) ; q . reevaluateConditions_ ( ) ; assertFalse ( block . isVisible ( ) ) ; q . setAdminMode ( true ) ; q . reevaluateConditions_ ( ) ; assertTrue ( block . isVisible ( ) ) ; }
Tests whether items with auth set to 'admin' are visible in admin-mode and
 invisible otherwise.
Tests whether items with auth set to ' admin ' are visible in admin - mode and invisible otherwise .
// No auth parameter set. // Auth parameter set, and not in admin mode. // Auth parameter set and in admin mode.