-
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(me): Create record by duplicating remote record.
- Loading branch information
Romuald Caplier
committed
Sep 12, 2024
1 parent
9075aa6
commit e748008
Showing
28 changed files
with
1,078 additions
and
78 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,79 @@ | ||
// eslint-disable-next-line @nx/enforce-module-boundaries | ||
import { simpleDatasetRecordAsXmlFixture } from '@geonetwork-ui/common/fixtures' | ||
|
||
describe('import', () => { | ||
beforeEach(() => { | ||
cy.login('admin', 'admin', false) | ||
cy.visit('/catalog/search') | ||
}) | ||
|
||
describe('import a record', () => { | ||
beforeEach(() => { | ||
// Open the import overlay | ||
cy.get('[data-test="import-record"]').click() | ||
}) | ||
|
||
it('should show the import menu overlay', () => { | ||
cy.get('gn-ui-import-record').should('be.visible') | ||
cy.get('[data-test="importMenuMainSection"]').should('be.visible') | ||
}) | ||
|
||
describe('import by URL section', () => { | ||
beforeEach(() => { | ||
cy.get('[data-test="importFromUrlButton"]').click() | ||
}) | ||
|
||
it('should show the import by URL section', () => { | ||
cy.get('[data-test="importMenuImportExternalFileSection"]').should( | ||
'be.visible' | ||
) | ||
}) | ||
|
||
it('should show the import by URL section', () => { | ||
cy.get('[data-test="importMenuImportExternalFileSection"]').should( | ||
'be.visible' | ||
) | ||
}) | ||
|
||
it('should import a record', () => { | ||
cy.get('[data-test="importMenuImportExternalFileSection"]') | ||
.find('gn-ui-url-input') | ||
.type('http://www.marvelous-record/xml/download') | ||
|
||
cy.intercept( | ||
{ | ||
method: 'GET', | ||
url: /\/xml\/download$/, | ||
}, | ||
{ | ||
statusCode: 200, | ||
body: simpleDatasetRecordAsXmlFixture(), | ||
} | ||
).as('importUrlRequest') | ||
|
||
cy.get('gn-ui-url-input').find('gn-ui-button').find('button').click() | ||
|
||
// Check that the record is correctly displayed | ||
cy.get('gn-ui-record-form').should('be.visible') | ||
|
||
cy.get('gn-ui-record-form') | ||
.find('gn-ui-form-field') | ||
.eq(0) | ||
.find('input') | ||
.invoke('val') | ||
.should('contain', 'Copy') | ||
}) | ||
|
||
it('should be able to navigate back to the main section', () => { | ||
cy.get( | ||
'[data-test="importMenuImportExternalFileSectionBackButton"]' | ||
).click() | ||
|
||
cy.get('[data-test="importMenuMainSection"]').should('be.visible') | ||
cy.get('[data-test="importMenuImportExternalFileSection"]').should( | ||
'not.exist' | ||
) | ||
}) | ||
}) | ||
}) | ||
}) |
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
Oops, something went wrong.