function validateEvents(events, features) {
    const startevent = events[0];
    const endevent = events[events.length - 1];

    // first event should be modifystart
    expect(startevent).to.be.a(ModifyEvent);
    expect(startevent.type).to.eql('modifystart');

    // last event should be modifyend
    expect(endevent).to.be.a(ModifyEvent);
    expect(endevent.type).to.eql('modifyend');

    // make sure we get change events to events array
    expect(events.length > 2).to.be(true);
    // middle events should be feature modification events
    for (let i = 1; i < events.length - 1; i++) {
      expect(events[i]).to.equal('change');
    }

    // ModifyEvents should include the expected features
    expect(startevent.features.getArray()).to.eql(features);
    expect(endevent.features.getArray()).to.eql(features);
  }
/**
   * Validates the event array to verify proper event sequence. Checks
   * that first and last event are correct ModifyEvents and that feature
   * modifications event are in between.
   * @param {Array<ModifyEvent|string>} events The events.
   * @param {Array<ol.Feature>} features The features.
   */
Validates the event array to verify proper event sequence. Checks
that first and last event are correct ModifyEvents and that feature
modifications event are in between.
@param {Array} events The events.
@param {Array} features The features.
Validates the event array to verify proper event sequence . Checks that first and last event are correct ModifyEvents and that feature modifications event are in between . @param { Array } events The events . @param { Array } features The features .
function validateEvents(events, features) {
    const startevent = events[0];
    const endevent = events[events.length - 1];
    expect(startevent).to.be.a(ModifyEvent);
    expect(startevent.type).to.eql('modifystart');
    expect(endevent).to.be.a(ModifyEvent);
    expect(endevent.type).to.eql('modifyend');
    expect(events.length > 2).to.be(true);
    for (let i = 1; i < events.length - 1; i++) {
      expect(events[i]).to.equal('change');
    }
    expect(startevent.features.getArray()).to.eql(features);
    expect(endevent.features.getArray()).to.eql(features);
  }
function validateEvents ( events , features ) { const startevent = events [ 0 ] ; const endevent = events [ events . length - 1 ] ; expect ( startevent ) . to . be . a ( ModifyEvent ) ; expect ( startevent . type ) . to . eql ( 'modifystart' ) ; expect ( endevent ) . to . be . a ( ModifyEvent ) ; expect ( endevent . type ) . to . eql ( 'modifyend' ) ; expect ( events . length > 2 ) . to . be ( true ) ; for ( let i = 1 ; i < events . length - 1 ; i ++ ) { expect ( events [ i ] ) . to . equal ( 'change' ) ; } expect ( startevent . features . getArray ( ) ) . to . eql ( features ) ; expect ( endevent . features . getArray ( ) ) . to . eql ( features ) ; }
Validates the event array to verify proper event sequence.
Validates the event array to verify proper event sequence .
// first event should be modifystart // last event should be modifyend // make sure we get change events to events array // middle events should be feature modification events // ModifyEvents should include the expected features