function testChangeRequiredItemWarning() {
  var q = new vsaq.Questionnaire(root);
  q.setTemplate(QUESTIONNAIRE);

  var unfilled = q.getUnfilledRequiredItems();
  assertEquals(unfilled.length, 2);
  // Add a warning to all required but unfilled items.
  goog.structs.forEach(unfilled, function(item, id, items) {
    q.changeRequiredItemWarning(item, true);
    var labelElement = /** @type {!HTMLLabelElement} */ (
        vsaq.questionnaire.utils.findById(item.container, item.id + '-title'));
    assertTrue(goog.dom.classlist.contains(
        labelElement, 'vsaq-unfilled-highlight'));
    q.changeRequiredItemWarning(item, false);
    assertFalse(goog.dom.classlist.contains(
        labelElement, 'vsaq-unfilled-highlight'));
  }, this);
}
/**
 * Tests notification behavior for required items.
 */
Tests notification behavior for required items.
Tests notification behavior for required items .
function testChangeRequiredItemWarning() {
  var q = new vsaq.Questionnaire(root);
  q.setTemplate(QUESTIONNAIRE);
  var unfilled = q.getUnfilledRequiredItems();
  assertEquals(unfilled.length, 2);
  goog.structs.forEach(unfilled, function(item, id, items) {
    q.changeRequiredItemWarning(item, true);
    var labelElement =  (
        vsaq.questionnaire.utils.findById(item.container, item.id + '-title'));
    assertTrue(goog.dom.classlist.contains(
        labelElement, 'vsaq-unfilled-highlight'));
    q.changeRequiredItemWarning(item, false);
    assertFalse(goog.dom.classlist.contains(
        labelElement, 'vsaq-unfilled-highlight'));
  }, this);
}
function testChangeRequiredItemWarning ( ) { var q = new vsaq . Questionnaire ( root ) ; q . setTemplate ( QUESTIONNAIRE ) ; var unfilled = q . getUnfilledRequiredItems ( ) ; assertEquals ( unfilled . length , 2 ) ; goog . structs . forEach ( unfilled , function ( item , id , items ) { q . changeRequiredItemWarning ( item , true ) ; var labelElement = ( vsaq . questionnaire . utils . findById ( item . container , item . id + '-title' ) ) ; assertTrue ( goog . dom . classlist . contains ( labelElement , 'vsaq-unfilled-highlight' ) ) ; q . changeRequiredItemWarning ( item , false ) ; assertFalse ( goog . dom . classlist . contains ( labelElement , 'vsaq-unfilled-highlight' ) ) ; } , this ) ; }
Tests notification behavior for required items.
Tests notification behavior for required items .
// Add a warning to all required but unfilled items. /** @type {!HTMLLabelElement} */