-
Notifications
You must be signed in to change notification settings - Fork 16
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 #414 from IQSS/407-create-dataset-prefill
407 create dataset prefill
- Loading branch information
Showing
12 changed files
with
94 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
export interface User { | ||
name: string | ||
displayName: string | ||
persistentId: string | ||
firstName: string | ||
lastName: string | ||
email: string | ||
affiliation?: string | ||
} |
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 |
---|---|---|
|
@@ -3,8 +3,12 @@ import { User } from '../../../../../src/users/domain/models/User' | |
export class UserMother { | ||
static create(): User { | ||
return { | ||
name: 'James D. Potts', | ||
persistentId: 'jamesPotts' | ||
displayName: 'James D. Potts', | ||
persistentId: 'jamesPotts', | ||
firstName: 'James', | ||
lastName: 'Potts', | ||
email: '[email protected]', | ||
affiliation: 'Harvard University' | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -20,17 +20,6 @@ describe('Create Dataset', () => { | |
cy.visit('/spa/datasets/create') | ||
|
||
cy.findByLabelText(/^Title/i).type('Test Dataset Title', { force: true }) | ||
cy.findByText('Author') | ||
.closest('.row') | ||
.within(() => { | ||
cy.findByLabelText(/^Name/i).type('Test author name', { force: true }) | ||
}) | ||
|
||
cy.findByText('Point of Contact') | ||
.closest('.row') | ||
.within(() => { | ||
cy.findByLabelText(/^E-mail/i).type('[email protected]', { force: true }) | ||
}) | ||
|
||
cy.findByText('Description') | ||
.closest('.row') | ||
|
@@ -45,7 +34,6 @@ describe('Create Dataset', () => { | |
|
||
cy.findByLabelText('Agricultural Sciences').click() | ||
}) | ||
|
||
cy.findByText(/Save Dataset/i).click() | ||
|
||
cy.findByRole('heading', { name: 'Test Dataset Title' }).should('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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,15 @@ const userRepository = new UserJSDataverseRepository() | |
describe('User JSDataverse Repository', () => { | ||
before(() => TestsUtils.setup()) | ||
beforeEach(() => TestsUtils.login()) | ||
|
||
it('gets the authenticated user', async () => { | ||
const expectedUser = { name: 'Dataverse Admin', persistentId: 'dataverseAdmin' } | ||
const expectedUser = { | ||
displayName: 'Dataverse Admin', | ||
persistentId: 'dataverseAdmin', | ||
firstName: 'Dataverse', | ||
lastName: 'Admin', | ||
email: '[email protected]', | ||
affiliation: 'Dataverse.org' | ||
} | ||
const user = await userRepository.getAuthenticated() | ||
|
||
expect(user).to.deep.equal(expectedUser) | ||
|