Addepar/ember-classy-page-object

Nested collection bug

billy-addepar opened this issue · 0 comments

I have a table that contains a collection of rows whose element contains a collection of cells.

  rows: collection({
    scope: 'tr',

    cells: collection({
      scope: 'td'
    })
  }),

When I use forEach to iterate through all cells and print cell text, it prints incorrect result.

      this.rows.forEach((row) => {
        row.cells.forEach((cell) => {
          console.log(cell.text);
        })
      })

Further debugging shows that cell text does not match row text:

screen shot 2017-12-06 at 11 21 41 am

This makes me believe that there is a bug with nested collection.