-
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.
Merge pull request #945 from geonetwork/me-fix-save-gn-425
Metadata Editor / fix error when saving with GeoNetwork 4.2.5+
- Loading branch information
Showing
15 changed files
with
138 additions
and
51 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
describe('editor form', () => { | ||
beforeEach(() => { | ||
cy.login('admin', 'admin', false) | ||
|
||
// Alpine convention record | ||
cy.visit('/edit/8698bf0b-fceb-4f0f-989b-111e7c4af0a4') | ||
|
||
cy.clearRecordDrafts() | ||
|
||
// aliases | ||
cy.get('gn-ui-form-field[ng-reflect-model=abstract] textarea').as( | ||
'abstractField' | ||
) | ||
cy.get('@abstractField').invoke('val').as('abstractFieldInitialValue') | ||
cy.get('[data-cy=save-status]') | ||
.invoke('attr', 'data-cy-value') | ||
.as('saveStatus') | ||
}) | ||
|
||
it('form shows correctly', () => { | ||
cy.get('gn-ui-record-form').should('be.visible') | ||
cy.get('gn-ui-record-form gn-ui-form-field').should('have.length.gt', 0) | ||
cy.get('@abstractField') | ||
.invoke('val') | ||
.should('contain', 'Perimeter der Alpenkonvention in der Schweiz.') | ||
cy.get('@saveStatus').should('eq', 'record_up_to_date') | ||
cy.screenshot({ capture: 'fullPage' }) | ||
}) | ||
|
||
it('draft record is kept', () => { | ||
cy.get('@abstractField').clear() | ||
cy.get('@abstractField').type('modified abstract') | ||
// eslint-disable-next-line cypress/no-unnecessary-waiting | ||
cy.wait(1000) // waiting for draft saving to kick in | ||
cy.reload() | ||
cy.get('@abstractField').invoke('val').should('eq', 'modified abstract') | ||
cy.get('@saveStatus').should('eq', 'draft_changes_pending') | ||
|
||
cy.clearRecordDrafts() | ||
|
||
cy.get('@saveStatus').should('eq', 'record_up_to_date') | ||
cy.get('@abstractField') | ||
.invoke('val') | ||
.should('contain', 'Perimeter der Alpenkonvention in der Schweiz.') | ||
}) | ||
|
||
it('saving record works', () => { | ||
cy.get('@abstractField').clear() | ||
cy.get('@abstractField').type('modified abstract before saving') | ||
cy.get('md-editor-publish-button').click() | ||
cy.get('@saveStatus').should('eq', 'record_up_to_date') | ||
|
||
// restore abstract | ||
cy.get('@abstractField').clear() | ||
cy.get('@abstractField').then(function (field) { | ||
cy.wrap(field).type(this.abstractFieldInitialValue) | ||
}) | ||
cy.get('md-editor-publish-button').click() | ||
}) | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
GEONETWORK_VERSION=4.2.2 | ||
ELASTICSEARCH_VERSION=7.17.15 |
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