-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(datahub): finish organization-page
- Loading branch information
Romuald Caplier
committed
Jun 14, 2024
1 parent
96cc908
commit ad0c763
Showing
16 changed files
with
234 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
import 'cypress-real-events' | ||
|
||
describe('organizations', () => { | ||
beforeEach(() => { | ||
cy.visit('organization/Barbie%20Inc.') | ||
|
||
// aliases | ||
cy.get('gn-ui-navigation-button').as('backButton') | ||
cy.get('[data-cy="organizationHeaderName"]').as('organizationHeaderName') | ||
cy.get('[data-cy="organizationHeaderWebsiteLink"]').as( | ||
'organizationHeaderWebsiteLink' | ||
) | ||
cy.get('[data-cy="organizationDescription"]').as('organizationDescription') | ||
cy.get('gn-ui-max-lines').contains('Read more').as('readMoreButton') | ||
cy.get('[data-cy="organizationLogo"]').as('organizationLogo') | ||
cy.get('[data-cy="organizationDatasetCount"]').as( | ||
'organizationDatasetCount' | ||
) | ||
cy.get('[data-cy="organizationEmail"]').as('organizationEmail') | ||
cy.get('[data-cy="organizationPageLastPublishedDatasets"]').as( | ||
'organizationPageLastPublishedDatasets' | ||
) | ||
cy.get( | ||
'[data-cy="organizationDetailsLastPublishedDatasetsSearchAllButton"]' | ||
).as('organizationDetailsLastPublishedDatasetsSearchAllButton') | ||
}) | ||
|
||
describe('general display', () => { | ||
describe('header', () => { | ||
describe('back button', () => { | ||
beforeEach(() => { | ||
// Simulate that we come from the organizations search page | ||
cy.visit('organisations') | ||
cy.visit('organization/Barbie%20Inc.') | ||
}) | ||
|
||
it('back button goes to the previous visited page', () => { | ||
cy.get('@backButton').click() | ||
cy.url().should('include', '/organisations') | ||
}) | ||
}) | ||
|
||
it('should display the organization name', () => { | ||
cy.get('@organizationHeaderName').should('contain', 'Barbie Inc.') | ||
}) | ||
|
||
it('should display the organization website link', () => { | ||
cy.get('@organizationHeaderWebsiteLink') | ||
.should('be.visible') | ||
.should('have.attr', 'href', 'https://www.barbie-inc.com/') | ||
.and('have.attr', 'target', '_blank') | ||
}) | ||
}) | ||
|
||
describe('details', () => { | ||
describe('left column', () => { | ||
it('should display the organization description', () => { | ||
cy.get('@organizationDescription').should('be.visible') | ||
}) | ||
|
||
it('click on read more should expand the organization description', () => { | ||
let initialDescription | ||
let newDescription | ||
|
||
cy.get('@organizationDescription').then((firstDescription) => { | ||
initialDescription = firstDescription | ||
cy.get('@readMoreButton').trigger('click') | ||
cy.get('@organizationDescription').then((secondDescription) => { | ||
newDescription = secondDescription | ||
expect(newDescription).to.not.equal(initialDescription) | ||
}) | ||
}) | ||
}) | ||
}) | ||
|
||
describe('right column', () => { | ||
it('should display the organization logo', () => { | ||
cy.get('@organizationLogo').should('be.visible') | ||
}) | ||
|
||
it('should display the organization dataset count', () => { | ||
cy.get('@organizationDatasetCount').should('be.visible') | ||
}) | ||
|
||
it('a click on the organization dataset count should open the dataset search page filtered on the organization', () => { | ||
cy.get('@organizationDatasetCount').then(($link) => { | ||
const url = $link.prop('href') | ||
cy.wrap($link).click() | ||
|
||
cy.url().should('eq', url) | ||
}) | ||
}) | ||
|
||
it('should display the organization email', () => { | ||
cy.get('@organizationEmail') | ||
.should('be.visible') | ||
.and('have.attr', 'href', 'mailto:[email protected]') | ||
}) | ||
}) | ||
|
||
describe('last published datasets', () => { | ||
it('should display the last published datasets', () => { | ||
cy.get('@organizationPageLastPublishedDatasets').should('be.visible') | ||
}) | ||
|
||
it('should display the search all button', () => { | ||
cy.get( | ||
'@organizationDetailsLastPublishedDatasetsSearchAllButton' | ||
).should('be.visible') | ||
}) | ||
|
||
it('a click on the search all button should open the dataset search page filtered on the organization', () => { | ||
cy.get( | ||
'@organizationDetailsLastPublishedDatasetsSearchAllButton' | ||
).then(($link) => { | ||
const url = $link.prop('href') | ||
cy.wrap($link).click() | ||
|
||
cy.url().should('eq', url) | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.list-page-dot { | ||
width: 6px; | ||
height: 6px; | ||
border-radius: 6px; | ||
position: relative; | ||
} | ||
|
||
.list-page-dot:after { | ||
content: ''; | ||
position: absolute; | ||
left: -7px; | ||
top: -7px; | ||
width: 20px; | ||
height: 20px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
apps/datahub/src/app/organization/organization-page/organization-page.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.