src/tests/extras/filters/event_labeler_builder_test.js
/**
 * Verifies that if an event hit has an existing label, the powers-of-two
 * labeler will append the new label to the existing one, and strips the value
 * if that is configured.
 */
Verifies that if an event hit has an existing label, the powers-of-two
labeler will append the new label to the existing one, and strips the value
if that is configured.
Verifies that if an event hit has an existing label the powers - of - two labeler will append the new label to the existing one and strips the value if that is configured .
function testPowersOfTwoLabeler_WithExistingLabel_WithAppendAndStrippedValue() {
  var hit = analytics.testing.Hits.createEventHit(100);
  hit.getParameters().set(analytics.Parameters.EVENT_LABEL, 'asdf');
  var labeler = new analytics.filters.EventLabelerBuilder().
      powersOfTwo().
      appendToExistingLabel().
      stripValue().
      build();
  labeler(hit);
  assertEquals('asdf - 65-128',
      hit.getParameters().get(analytics.Parameters.EVENT_LABEL));
  assertNull(hit.getParameters().get(analytics.Parameters.EVENT_VALUE));
}
function testPowersOfTwoLabeler_WithExistingLabel_WithAppendAndStrippedValue ( ) { var hit = analytics . testing . Hits . createEventHit ( 100 ) ; hit . getParameters ( ) . set ( analytics . Parameters . EVENT_LABEL , 'asdf' ) ; var labeler = new analytics . filters . EventLabelerBuilder ( ) . powersOfTwo ( ) . appendToExistingLabel ( ) . stripValue ( ) . build ( ) ; labeler ( hit ) ; assertEquals ( 'asdf - 65-128' , hit . getParameters ( ) . get ( analytics . Parameters . EVENT_LABEL ) ) ; assertNull ( hit . getParameters ( ) . get ( analytics . Parameters . EVENT_VALUE ) ) ; }
Verifies that if an event hit has an existing label, the powers-of-two
 labeler will append the new label to the existing one, and strips the value
 if that is configured.
Verifies that if an event hit has an existing label the powers - of - two labeler will append the new label to the existing one and strips the value if that is configured .