Skip to content

Commit

Permalink
e2e(datahub): adapt following component refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
jahow committed Nov 3, 2023
1 parent 4bf2f00 commit 54d1b3d
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ describe('dataset pages', () => {
.filter(':visible')
.as('navBtns')
cy.get('@navBtns').eq(3).click()
cy.get('gn-ui-data-otherlinks').should('be.visible')
cy.get('datahub-record-otherlinks').should('be.visible')
})
})
})

describe('ABOUT SECTION : display & functions', () => {
describe('display', () => {
it('should display the description', () => {
cy.get('gn-ui-record-metadata')
cy.get('datahub-record-metadata')
.find('[id="about"]')
.find('gn-ui-metadata-info')
.find('gn-ui-content-ghost')
Expand All @@ -112,25 +112,25 @@ describe('dataset pages', () => {
})
})
it('should display the contact details', () => {
cy.get('gn-ui-record-metadata')
cy.get('datahub-record-metadata')
.find('[id="about"]')
.find('gn-ui-metadata-contact')
.should('have.length', 1)
cy.get('gn-ui-record-metadata')
cy.get('datahub-record-metadata')
.find('[id="about"]')
.find('gn-ui-metadata-contact')
.children('div')
.children('a')
.eq(0)
.invoke('text')
.should('include', '@')
cy.get('gn-ui-record-metadata')
cy.get('datahub-record-metadata')
.find('[id="about"]')
.find('gn-ui-metadata-catalog')
.should('have.length', 1)
})
it('should display the catalog details', () => {
cy.get('gn-ui-record-metadata')
cy.get('datahub-record-metadata')
.find('[id="about"]')
.find('gn-ui-metadata-catalog')
.children('div')
Expand All @@ -142,7 +142,7 @@ describe('dataset pages', () => {
})
})
it('should display the keywords', () => {
cy.get('gn-ui-record-metadata')
cy.get('datahub-record-metadata')
.find('[id="about"]')
.find('gn-ui-metadata-info')
.children('div')
Expand All @@ -151,7 +151,7 @@ describe('dataset pages', () => {
.should('have.length.gt', 0)
})
it('should display the lineage and usage tabs', () => {
cy.get('gn-ui-record-metadata')
cy.get('datahub-record-metadata')
.find('[id="about"]')
.find('gn-ui-metadata-info')
.find('gn-ui-expandable-panel')
Expand All @@ -161,7 +161,7 @@ describe('dataset pages', () => {
let targetLink
let keyword
it('should go to provider website on click', () => {
cy.get('gn-ui-record-metadata')
cy.get('datahub-record-metadata')
.find('[id="about"]')
.find('gn-ui-metadata-contact')
.children('div')
Expand All @@ -178,7 +178,7 @@ describe('dataset pages', () => {
})
})
it('should go to dataset search page when clicking on org name and filter by org', () => {
cy.get('gn-ui-record-metadata')
cy.get('datahub-record-metadata')
.find('[id="about"]')
.find('gn-ui-metadata-contact')
.children('div')
Expand All @@ -189,7 +189,7 @@ describe('dataset pages', () => {
cy.url().should('include', '/search?publisher=')
})
it('should go to dataset search page when clicking on keyword and filter by keyword', () => {
cy.get('gn-ui-record-metadata')
cy.get('datahub-record-metadata')
.find('[id="about"]')
.find('gn-ui-metadata-info')
.children('div')
Expand All @@ -214,7 +214,7 @@ describe('dataset pages', () => {

describe('PREVIEW SECTION : display & functions', () => {
beforeEach(() => {
cy.get('gn-ui-record-metadata')
cy.get('datahub-record-metadata')
.find('[id="preview"]')
.first()
.as('previewSection')
Expand Down Expand Up @@ -323,14 +323,14 @@ describe('dataset pages', () => {
describe('DOWNLOADS : display & functions', () => {
describe('display', () => {
it('should have at least one download button', () => {
cy.get('gn-ui-data-downloads')
cy.get('datahub-record-downloads')
.find('gn-ui-download-item')
.should('have.length.gt', 0)
})
it('should have one button per download type + all and others', () => {
cy.get('[data-cy="download-format"]').then((format) => {
const formatString = format.text()
cy.get('gn-ui-data-downloads')
cy.get('datahub-record-downloads')
.find('gn-ui-button')
.children('button')
.then((btn) => {
Expand All @@ -356,7 +356,7 @@ describe('dataset pages', () => {
})
describe('features', () => {
it('filters the download list on format filter click', () => {
cy.get('gn-ui-data-downloads')
cy.get('datahub-record-downloads')
.find('gn-ui-button')
.children('button')
.eq(1)
Expand All @@ -373,7 +373,7 @@ describe('dataset pages', () => {
})
})
it('downloads a file on click', () => {
cy.get('gn-ui-data-downloads')
cy.get('datahub-record-downloads')
.find('gn-ui-download-item')
.first()
.click()
Expand All @@ -391,21 +391,21 @@ describe('dataset pages', () => {
describe('LINKS : display & functions', () => {
describe('display', () => {
it('should have external, API and internal links with one option', () => {
cy.get('gn-ui-data-otherlinks')
cy.get('datahub-record-otherlinks')
.find('gn-ui-link-card')
.should('have.length.gt', 0)
cy.get('gn-ui-data-apis')
cy.get('datahub-record-apis')
.find('gn-ui-api-card')
.should('have.length.gt', 0)
cy.get('#related-records')
.find('gn-ui-related-records')
.find('datahub-record-related-records')
.find('gn-ui-related-record-card')
.should('have.length.gt', 0)
})
})
describe('features', () => {
it('goes to external link on click', () => {
cy.get('gn-ui-data-otherlinks')
cy.get('datahub-record-otherlinks')
.find('gn-ui-link-card')
.first()
.children('a')
Expand All @@ -420,7 +420,7 @@ describe('dataset pages', () => {
})
})
it('copies the API path on click', () => {
cy.get('gn-ui-data-apis')
cy.get('datahub-record-apis')
.find('gn-ui-copy-text-button')
.find('button')
.first()
Expand All @@ -437,7 +437,7 @@ describe('dataset pages', () => {
it('goes to dataset on click', () => {
let targetLink
cy.get('#related-records')
.find('gn-ui-related-records')
.find('datahub-record-related-records')
.find('gn-ui-related-record-card')
.first()
.children('a')
Expand All @@ -458,7 +458,7 @@ describe('dataset pages', () => {
describe('record with file distributions', () => {
beforeEach(() => {
cy.visit('/dataset/n_tri_lill_inondable_s_059')
cy.get('gn-ui-record-metadata')
cy.get('datahub-record-metadata')
.find('[id="preview"]')
.first()
.as('previewSection')
Expand Down

0 comments on commit 54d1b3d

Please sign in to comment.