-
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 18, 2024
1 parent
96cc908
commit 48e0ce8
Showing
35 changed files
with
479 additions
and
246 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,118 @@ | ||
import 'cypress-real-events' | ||
|
||
describe('organizations', () => { | ||
beforeEach(() => { | ||
cy.visit('organization/Barbie%20Inc.') | ||
|
||
// aliases | ||
cy.get('gn-ui-navigation-button').as('backButton') | ||
cy.get('[data-test="organizationHeaderName"]').as('organizationHeaderName') | ||
cy.get('[data-test="organizationHeaderWebsiteLink"]').as( | ||
'organizationHeaderWebsiteLink' | ||
) | ||
cy.get('[data-test="organizationDescription"]').as( | ||
'organizationDescription' | ||
) | ||
cy.get('gn-ui-max-lines').contains('Read more').as('readMoreButton') | ||
cy.get('[data-test="organizationLogo"]').as('organizationLogo') | ||
cy.get('[data-test="organizationDatasetCount"]').as( | ||
'organizationDatasetCount' | ||
) | ||
cy.get('[data-test="organizationEmail"]').as('organizationEmail') | ||
cy.get('[data-test="orgPageLasPubDat"]').as('orgPageLasPubDat') | ||
cy.get('[data-test="orgDetailsSearchAllBtn"]').as('orgDetailsSearchAllBtn') | ||
}) | ||
|
||
describe('general display', () => { | ||
describe('header', () => { | ||
describe('back button', () => { | ||
beforeEach(() => { | ||
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('@orgPageLasPubDat').should('be.visible') | ||
}) | ||
|
||
it('should display the search all button', () => { | ||
cy.get('@orgDetailsSearchAllBtn').should('be.visible') | ||
}) | ||
|
||
it('a click on the search all button should open the dataset search page filtered on the organization', () => { | ||
cy.get('@orgDetailsSearchAllBtn').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
54 changes: 0 additions & 54 deletions
54
apps/datahub/src/app/organization/header-organization/organization-header.component.html
This file was deleted.
Oops, something went wrong.
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; | ||
} |
Oops, something went wrong.