test-support/helpers/assert-model-properties-on-page.js
/**
 * Given some models and an array of properties, check that all given properties are on the given page object collection for every model
 * Each page object collection item must have a property `modelId` that gives the ID of the rendered model
 *
 * @function assertPropertiesAllModelsAreOnPage
 * @param models
 * @param properties
 * @param pageCollection
 * @param {Function} transform
 * @public
 */
Given some models and an array of properties, check that all given properties are on the given page object collection for every model
Each page object collection item must have a property `modelId` that gives the ID of the rendered model


Given some models and an array of properties check that all given properties are on the given page object collection for every model Each page object collection item must have a property ` modelId ` that gives the ID of the rendered model
function assertPropertiesOfAllModelsOnPage(models, properties, pageCollection, transform) {
  expect(models).to.be.an('array');
  models.forEach((modelInstance) => {
    let id = get(modelInstance, 'id');
    let [ collectionItem ] = pageCollection().filterBy('modelId', id);
    expect(collectionItem, `No collection item found for model ID ${id}`).to.exist;
    return assertModelPropertiesOnPage(modelInstance, properties, collectionItem, transform);
  });
}
function assertPropertiesOfAllModelsOnPage ( models , properties , pageCollection , transform ) { expect ( models ) . to . be . an ( 'array' ) ; models . forEach ( ( modelInstance ) => { let id = get ( modelInstance , 'id' ) ; let [ collectionItem ] = pageCollection ( ) . filterBy ( 'modelId' , id ) ; expect ( collectionItem , ` ${ id } ` ) . to . exist ; return assertModelPropertiesOnPage ( modelInstance , properties , collectionItem , transform ) ; } ) ; }
Given some models and an array of properties, check that all given properties are on the given page object collection for every model
 Each page object collection item must have a property `modelId` that gives the ID of the rendered model
Given some models and an array of properties check that all given properties are on the given page object collection for every model Each page object collection item must have a property ` modelId ` that gives the ID of the rendered model