I have a html table with the following data:
id | name
I need to test the order of table items. I can get the rows using:
wrapper.findAll('table tr')
But how can I assert the order of rows paring the columns (tds) ? Thanks.
I have a html table with the following data:
id | name
I need to test the order of table items. I can get the rows using:
wrapper.findAll('table tr')
But how can I assert the order of rows paring the columns (tds) ? Thanks.
You can do something like this:
let $rows = wrapper.findAll('tbody > tr').wrappers
let column1 = $rows.map(row => {
return row.
findAll('td')
.at(0)
.text()
})
expect(column1[0]).toBe('text 1')
expect(column1[1]).toBe('text 2')