function testValueItemAnswerChanged() {
  var mock = new goog.testing.MockControl();
  mock.createMethodMock(valueItem, 'getValue');
  mock.createMethodMock(valueItem.eventDispatcher, 'dispatchEvent');
  var expectedChanges = {};
  expectedChanges[ID] = VALUE;
  var expectedEvent = {
    type: vsaq.questionnaire.items.Item.CHANGED,
    source: valueItem,
    changes: expectedChanges
  };
  valueItem.getValue().$returns(VALUE);
  valueItem.eventDispatcher.dispatchEvent(
      new goog.testing.mockmatchers.ObjectEquals(expectedEvent));

  mock.$replayAll();
  valueItem.answerChanged({});
  mock.$verifyAll();
}
/**
 * Tests whether events are correctly dispatched when the answer changes.
 */
Tests whether events are correctly dispatched when the answer changes.
Tests whether events are correctly dispatched when the answer changes .
function testValueItemAnswerChanged() {
  var mock = new goog.testing.MockControl();
  mock.createMethodMock(valueItem, 'getValue');
  mock.createMethodMock(valueItem.eventDispatcher, 'dispatchEvent');
  var expectedChanges = {};
  expectedChanges[ID] = VALUE;
  var expectedEvent = {
    type: vsaq.questionnaire.items.Item.CHANGED,
    source: valueItem,
    changes: expectedChanges
  };
  valueItem.getValue().$returns(VALUE);
  valueItem.eventDispatcher.dispatchEvent(
      new goog.testing.mockmatchers.ObjectEquals(expectedEvent));
  mock.$replayAll();
  valueItem.answerChanged({});
  mock.$verifyAll();
}
function testValueItemAnswerChanged ( ) { var mock = new goog . testing . MockControl ( ) ; mock . createMethodMock ( valueItem , 'getValue' ) ; mock . createMethodMock ( valueItem . eventDispatcher , 'dispatchEvent' ) ; var expectedChanges = { } ; expectedChanges [ ID ] = VALUE ; var expectedEvent = { type : vsaq . questionnaire . items . Item . CHANGED , source : valueItem , changes : expectedChanges } ; valueItem . getValue ( ) . $returns ( VALUE ) ; valueItem . eventDispatcher . dispatchEvent ( new goog . testing . mockmatchers . ObjectEquals ( expectedEvent ) ) ; mock . $replayAll ( ) ; valueItem . answerChanged ( { } ) ; mock . $verifyAll ( ) ; }
Tests whether events are correctly dispatched when the answer changes.
Tests whether events are correctly dispatched when the answer changes .