forked from geonetwork/geonetwork-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request geonetwork#877 from geonetwork/dh-organization-page
IGN - Organization Page
- Loading branch information
Showing
80 changed files
with
1,516 additions
and
162 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
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
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
2 changes: 1 addition & 1 deletion
2
apps/datahub/src/app/home/organisations-page/organisations-page.component.html
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<div class="container-lg mx-auto mt-8"> | ||
<gn-ui-organisations | ||
(orgSelect)="searchByOrganisation($event)" | ||
(orgSelect)="onOrganizationSelection($event)" | ||
></gn-ui-organisations> | ||
</div> |
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
Oops, something went wrong.