mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-12 11:17:01 +00:00

* Releases updated version of datahub-web client UI code * Fix typo in yarn lock * Change yarn lock to match yarn registry directories * Previous commit missed some paths * Even more changes to yarnlock missing in previous commit * Include codegen file for typings * Add files to get parity for datahub-web and current OS datahub-midtier * Add in typo fix from previous commit - change to proper license * Implement proper OS fix for person entity picture url * Workarounds for open source DH issues * Fixes institutional memory api and removes unopensourced tabs for datasets * Fixes search dataset deprecation and user search issue as a result of changes * Remove internal only options in the avatar menu
59 lines
2.2 KiB
TypeScript
59 lines
2.2 KiB
TypeScript
const emailAddress = 'nowhere@example.com';
|
|
const cc = 'nowhere1@example.com';
|
|
const bcc = 'nowhere-bcc@example.com';
|
|
const body = 'Message';
|
|
const subject = 'Email';
|
|
const base = 'mailto:';
|
|
const mailToEmail = `${base}${encodeURIComponent(emailAddress)}`;
|
|
|
|
export const emailMailToAsserts = [
|
|
{
|
|
expected: base,
|
|
args: void 0,
|
|
assertMsg: 'it should return a basic mailto: string without an email when no arguments are passed'
|
|
},
|
|
{
|
|
expected: base,
|
|
args: {},
|
|
assertMsg: 'it should return a basic mailto: string without an email when an empty object is passed'
|
|
},
|
|
{
|
|
expected: base,
|
|
args: { to: '' },
|
|
assertMsg:
|
|
'it should return a basic mailto: string without an email when an object with only an empty string in the `to` field is passed'
|
|
},
|
|
{
|
|
expected: `${mailToEmail}`,
|
|
args: { to: emailAddress },
|
|
assertMsg: 'it should return a mailto: string with an email when an object with only the `to` field is passed'
|
|
},
|
|
{
|
|
expected: `${mailToEmail}?cc=${encodeURIComponent(cc)}`,
|
|
args: { to: emailAddress, cc },
|
|
assertMsg: 'it should return a mailto: string with an email and a cc query when to and cc are passed in'
|
|
},
|
|
{
|
|
expected: `${mailToEmail}?cc=${encodeURIComponent(cc)}&subject=${encodeURIComponent(subject)}`,
|
|
args: { to: emailAddress, cc, subject },
|
|
assertMsg:
|
|
'it should return a mailto: string with an email, subject, and a cc query when to, subject, and cc are passed in'
|
|
},
|
|
{
|
|
expected: `${mailToEmail}?cc=${encodeURIComponent(cc)}&subject=${encodeURIComponent(
|
|
subject
|
|
)}&bcc=${encodeURIComponent(bcc)}`,
|
|
args: { to: emailAddress, cc, subject, bcc },
|
|
assertMsg:
|
|
'it should return a mailto: string with an email, subject, bcc, and a cc query when to, subject, bcc, and cc are passed in'
|
|
},
|
|
{
|
|
expected: `${mailToEmail}?cc=${encodeURIComponent(cc)}&subject=${encodeURIComponent(
|
|
subject
|
|
)}&bcc=${encodeURIComponent(bcc)}&body=${encodeURIComponent(body)}`,
|
|
args: { to: emailAddress, cc, subject, bcc, body },
|
|
assertMsg:
|
|
'it should return a mailto: string with an email, subject, bcc, body, and a cc query when to, subject, bcc, body, and cc are passed in'
|
|
}
|
|
];
|