Skip to content

Commit

Permalink
feat(dh): finish e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoinier committed Dec 6, 2023
1 parent 00aa81f commit 8d40a65
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ describe.only('api form', () => {
cy.get('@apiForm').find('input[type="checkbox"]').check()
cy.get('@apiForm').find('gn-ui-text-input').first().should('have.value', '')
})
it.only('should reset all 3 inputs and link on click', () => {
it('should reset all 3 inputs and link on click', () => {
cy.get('@apiForm').find('gn-ui-text-input').first().as('firstInput')
cy.get('@firstInput').clear()
cy.get('@firstInput').type('54')
Expand Down Expand Up @@ -591,21 +591,26 @@ describe.only('api form', () => {
.invoke('val')
.should('include', 'f=json')
})
it('should have close button', () => {
cy.get('@apiForm').siblings().find('button')
// sibling of apiForm
})
it('should close the panel on click', () => {
// get the close button
// click on it
// check that the panel does not exist
cy.get('@apiForm')
cy.get('gn-ui-record-api-form').prev().find('button').click()
cy.get('gn-ui-record-api-form').should('not.exist')
})
it('should switch to other card url if card already open', () => {
// get the current url
// do then
// click on other card button
// check that the url is now different
cy.get('@apiForm')
.find('gn-ui-copy-text-button')
.find('input')
.invoke('val')
.then((url) => {
cy.get('@apiForm').find('gn-ui-text-input').first().clear()
cy.get('@apiForm').find('gn-ui-text-input').first().type('54')
cy.get('gn-ui-api-card').eq(1).find('button').click()
cy.get('@apiForm')
.find('gn-ui-copy-text-button')
.find('input')
.invoke('val')
.then((newUrl) => {
expect(newUrl).to.not.eq(url)
})
})
})
})

0 comments on commit 8d40a65

Please sign in to comment.