-
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 #966 from geonetwork/ME/draft-rollback
ME: draft rollback
- Loading branch information
Showing
55 changed files
with
961 additions
and
868 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,33 @@ | ||
describe('undo', () => { | ||
beforeEach(() => { | ||
cy.login('admin', 'admin', false) | ||
cy.visit('/catalog/search') | ||
}) | ||
|
||
it('should restore the record and refresh the interface', () => { | ||
// First create a record and its draft | ||
cy.get('[data-cy="create-record"]').click() | ||
cy.get('gn-ui-form-field[ng-reflect-model=abstract] textarea').type( | ||
'record abstract' | ||
) | ||
cy.intercept({ | ||
method: 'PUT', | ||
pathname: '**/records', | ||
}).as('insertRecord') | ||
cy.get('md-editor-publish-button').click() | ||
cy.wait('@insertRecord') | ||
cy.url().should('contain', '/edit/') | ||
cy.get('[data-cy="undo-button"] button').should('be.disabled') | ||
cy.get('gn-ui-form-field[ng-reflect-model=abstract] textarea').type( | ||
'draft abstract' | ||
) | ||
// eslint-disable-next-line cypress/no-unnecessary-waiting | ||
cy.wait(1000) // waiting for draft saving to kick in | ||
cy.get('[data-cy="undo-button"]').click() | ||
cy.get('[data-cy="confirm-button"]').click() | ||
cy.get('gn-ui-form-field[ng-reflect-model=abstract] textarea').should( | ||
'have.value', | ||
'record abstract' | ||
) | ||
}) | ||
}) |
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
libs/feature/editor/src/lib/components/overview-upload/overview-upload.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
Oops, something went wrong.