Skip to content

Commit

Permalink
e2e(md-editor): more reliable test in dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
jahow committed Mar 9, 2024
1 parent 3caa5cf commit d59d9f8
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,16 @@ describe('dashboard', () => {
cy.url().should('include', 'sort=resourceTitleObject.default.keyword')
cy.get('.table-header-cell').eq(1).click()
cy.url().should('include', 'sort=-resourceTitleObject.default.keyword')
cy.get('gn-ui-results-table')
.find('.table-row-cell')
.eq(1)
.invoke('text')
.invoke('trim')
.then(function (newFirstItem) {
expect(newFirstItem).not.to.equal(this.originalFirstItem)
})

// this is wrapped in a then call because we want to have access to `this.originalFirstItem`
cy.get('gn-ui-results-table').then(function (table) {
cy.wrap(table)
.find('.table-row-cell')
.eq(1)
.invoke('text')
.invoke('trim')
.should('not.equal', this.originalFirstItem)
})
})
})

Expand Down

0 comments on commit d59d9f8

Please sign in to comment.