Skip to content

Commit 58cadf2

Browse files
committed
fix: email formats, use case, description of tests
1 parent 0ee5d25 commit 58cadf2

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

docs/useCases.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,6 @@ In ContactDTO, it takes the following information:
14281428

14291429
- **targetId**: the numeric identifier of the collection, dataset, or datafile. Persistent ids and collection aliases are not supported. (Optional)
14301430
- **identifier**: the alias of a collection or the persistence id of a dataset or datafile. (Optional)
1431-
- **subject**: the email subject line
1432-
- **body**: the email body to send
1431+
- **subject**: the email subject line.
1432+
- **body**: the email body to send.
14331433
- **fromEmail**: the email to list in the reply-to field.

test/functional/contact/SubmitContactInfo.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ describe('submitContactInfo', () => {
1111
)
1212
})
1313

14-
test('should return Contact result successfully', async () => {
14+
test('should return Contact result successfully with targetId', async () => {
1515
const contactDTO: ContactDTO = {
1616
targetId: 1,
1717
subject: 'Data Question',
1818
body: 'Please help me understand your data. Thank you!',
19-
fromEmail: 'example@gmail.com'
19+
fromEmail: 'example@dataverse.org'
2020
}
2121

2222
let contactInfo: Contact[] = []
@@ -26,7 +26,7 @@ describe('submitContactInfo', () => {
2626
throw new Error('Contact info should be submitted')
2727
} finally {
2828
expect(contactInfo).toBeDefined()
29-
expect(contactInfo[0].fromEmail).toEqual('example@gmail.com')
29+
expect(contactInfo[0].fromEmail).toEqual('example@dataverse.org')
3030
expect(contactInfo[0].subject).toEqual(expect.any(String))
3131
expect(contactInfo[0].body).toEqual(expect.any(String))
3232
}
@@ -36,7 +36,7 @@ describe('submitContactInfo', () => {
3636
const contactDTO: ContactDTO = {
3737
subject: 'General Inquiry',
3838
body: 'I have a general question.',
39-
fromEmail: 'example@gmail.com'
39+
fromEmail: 'example@dataverse.org'
4040
}
4141

4242
let contactInfo: Contact[] = []
@@ -46,18 +46,18 @@ describe('submitContactInfo', () => {
4646
throw new Error('Contact info should be submitted even if target id is missing')
4747
} finally {
4848
expect(contactInfo).toBeDefined()
49-
expect(contactInfo[0].fromEmail).toEqual('example@gmail.com')
49+
expect(contactInfo[0].fromEmail).toEqual('example@dataverse.org')
5050
expect(contactInfo[0].subject).toEqual(expect.any(String))
5151
expect(contactInfo[0].body).toEqual(expect.any(String))
5252
}
5353
})
5454

55-
test('should return Contact when contact info is successfully submitted', async () => {
55+
test('should return Contact when contact info is successfully submitted with identifier', async () => {
5656
const test2ContactDTO: ContactDTO = {
5757
identifier: 'root',
5858
subject: 'Data Question',
5959
body: 'Please help me understand your data. Thank you!',
60-
fromEmail: 'example@gmail.com'
60+
fromEmail: 'example@dataverse.org'
6161
}
6262
const contactInfo = await submitContactInfo.execute(test2ContactDTO)
6363

@@ -72,7 +72,7 @@ describe('submitContactInfo', () => {
7272
targetId: 0,
7373
subject: '',
7474
body: '',
75-
fromEmail: 'example@gmail.com'
75+
fromEmail: 'example@dataverse.org'
7676
}
7777
const expectedError = new WriteError(`[400] Feedback target object not found.`)
7878
await expect(submitContactInfo.execute(contactDTO)).rejects.toThrow(expectedError)

test/integration/contact/ContactRepository.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ describe('submitContactInfo', () => {
1616
targetId: 1,
1717
subject: 'Data Question',
1818
body: 'Please help me understand your data. Thank you!',
19-
fromEmail: 'example@gmail.com'
19+
fromEmail: 'example@dataverse.org'
2020
}
2121

2222
const test2ContactDTO: ContactDTO = {
2323
identifier: 'root',
2424
subject: 'Data Question',
2525
body: 'Please help me understand your data. Thank you!',
26-
fromEmail: 'example@gmail.com'
26+
fromEmail: 'example@dataverse.org'
2727
}
2828

2929
const sut: ContactRepository = new ContactRepository()
@@ -50,7 +50,7 @@ describe('submitContactInfo', () => {
5050
const contactDTOWithoutTargetId: Partial<ContactDTO> = {
5151
subject: 'General Inquiry',
5252
body: 'I have a general question.',
53-
fromEmail: 'example@gmail.com'
53+
fromEmail: 'example@dataverse.org'
5454
}
5555

5656
const contactInfo: Contact[] = await sut.submitContactInfo(

test/unit/contact/SubmitContactInfo.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { TestConstants } from '../../testHelpers/TestConstants'
55

66
describe('execute submit information to contacts', () => {
77
test('should return a Contact when repository call is successful', async () => {
8-
const fromEmail = 'example@gmail.com'
8+
const fromEmail = 'example@dataverse.org'
99

1010
const contactDTO: ContactDTO = {
1111
targetId: 6,

0 commit comments

Comments
 (0)