diff --git a/apps/metadata-editor-e2e/src/e2e/edit.cy.ts b/apps/metadata-editor-e2e/src/e2e/edit.cy.ts index 8dcc1b5fe8..12c4490447 100644 --- a/apps/metadata-editor-e2e/src/e2e/edit.cy.ts +++ b/apps/metadata-editor-e2e/src/e2e/edit.cy.ts @@ -70,12 +70,39 @@ describe('editor form', () => { cy.get('md-editor-publish-button').click() }) + describe('New record', () => { + beforeEach(() => { + cy.login('barbie', 'p4ssworD_', false) + + cy.visit('/create') + + cy.get('@accessAndContactPageSelectorButton').click() + }) + + it('should have the connected user information prefilled in the contacts for resource of the dataset', () => { + cy.get('[data-test=displayedRoles]').children().should('have.length', 1) + + cy.get('[data-test=displayedRoles]') + .children() + .find('gn-ui-contact-card') + .get('[data-test=contactCardName]') + .invoke('text') + .should('contain', 'Barbara Roberts') + + cy.get('[data-test=displayedRoles]') + .children() + .find('gn-ui-contact-card') + .get('[data-test=contactCardEmail]') + .invoke('text') + .should('contain', 'barbie@email.org') + }) + }) + describe('record fields', () => { describe('contacts for resources', () => { beforeEach(() => { cy.login('admin', 'admin', false) - // Alpine convention record cy.visit('/edit/accroche_velos') cy.get('@accessAndContactPageSelectorButton').click() diff --git a/libs/common/fixtures/src/lib/organisations.fixture.ts b/libs/common/fixtures/src/lib/organisations.fixture.ts index 811e990184..9ca4d95091 100644 --- a/libs/common/fixtures/src/lib/organisations.fixture.ts +++ b/libs/common/fixtures/src/lib/organisations.fixture.ts @@ -7,7 +7,7 @@ export const REGION_HAUT_DE_FRANCE_ORG_FIXTURE = (): Organization => ({ email: 'contact@region-haut-de-france.com', website: new URL('https://region-haut-de-france.com/'), logoUrl: new URL('https://region-haut-de-france.com/logo.png'), - recordCount: 27, + recordCount: 4, }) export const ORGANISATIONS_FIXTURE: Organization[] = deepFreeze([ diff --git a/libs/feature/editor/src/lib/components/contact-card/contact-card.component.html b/libs/feature/editor/src/lib/components/contact-card/contact-card.component.html index a205e4c41f..b6a73272a4 100644 --- a/libs/feature/editor/src/lib/components/contact-card/contact-card.component.html +++ b/libs/feature/editor/src/lib/components/contact-card/contact-card.component.html @@ -7,11 +7,13 @@ >