Skip to content

Commit

Permalink
reverting unwanted changes
Browse files Browse the repository at this point in the history
  • Loading branch information
g-saracca committed Sep 13, 2024
1 parent de436b9 commit bf9e6d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ export const MetadataForm = ({
useEffect(() => {
// Only on create mode, lets prefill specific fields with user data
if (mode === 'create' && user) {
const displayName = `${user.lastName}, ${user.firstName}`
setValue('citation.author.0.authorName', displayName)
setValue('citation.datasetContact.0.datasetContactName', displayName)
setValue('citation.author.0.authorName', user.displayName)
setValue('citation.datasetContact.0.datasetContactName', user.displayName)
setValue('citation.datasetContact.0.datasetContactEmail', user.email, {
shouldValidate: true
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,6 @@ describe('DatasetMetadataForm', () => {
})

it('pre-fills the form with user data', () => {
const displayName = `${testUser.lastName}, ${testUser.firstName}`
cy.mountAuthenticated(
<DatasetMetadataForm
mode="create"
Expand All @@ -1457,7 +1456,7 @@ describe('DatasetMetadataForm', () => {
cy.findByText('Author')
.closest('.row')
.within(() => {
cy.findByLabelText(/^Name/i).should('have.value', displayName)
cy.findByLabelText(/^Name/i).should('have.value', testUser.displayName)
})
cy.findByText('Author')
.closest('.row')
Expand All @@ -1467,7 +1466,7 @@ describe('DatasetMetadataForm', () => {
cy.findByText('Point of Contact')
.closest('.row')
.within(() => {
cy.findByLabelText(/^Name/i).should('have.value', displayName)
cy.findByLabelText(/^Name/i).should('have.value', testUser.displayName)
})
cy.findByText('Point of Contact')
.closest('.row')
Expand Down

0 comments on commit bf9e6d8

Please sign in to comment.