Skip to content

Commit

Permalink
fix: test 2 -d
Browse files Browse the repository at this point in the history
  • Loading branch information
arpowers committed Sep 1, 2024
1 parent 8ea76c1 commit 4cdeceb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions @fiction/core/plugin-email/test/endpoint.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ describe('transactional email', async () => {
const fictionAws = new FictionAws({ ...testUtils, awsAccessKey, awsAccessKeySecret })
const fictionMedia = new FictionMedia({ ...testUtils, fictionAws, awsBucketMedia })

await testUtils.init()
const { orgId } = await testUtils.init()

afterAll(async () => testUtils.close())

it('sends a transactional email', async () => {
const superImage = await fictionMedia.relativeMedia({ url: new URL('../img/fiction-icon.png', import.meta.url).href })
const footerImage = await fictionMedia.relativeMedia({ url: new URL('../img/fiction-email-footer.png', import.meta.url).href })
const superImage = await fictionMedia.relativeMedia({ url: new URL('../img/fiction-icon.png', import.meta.url).href, orgId })
const footerImage = await fictionMedia.relativeMedia({ url: new URL('../img/fiction-email-footer.png', import.meta.url).href, orgId })
const confirmEmail: TransactionalEmailConfig = {
to: 'arpowers@gmail.com',
fromName: 'Fiction.com',
Expand Down Expand Up @@ -133,7 +133,7 @@ describe('transactional email', async () => {
expect(result.data?.html).toMatchInlineSnapshot(`
"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html id="__vue-email" lang="en" dir="ltr"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Test Space (test email 🧪🧪🧪)</title><meta name="description" content="Welcome to Space 🚀 This is a test email to test formatting of various elements.🧪"><style data-id="__vue-email-style"> tbody{font-size: 1rem; line-height: 1.65;} h1, h2{ line-height: 1.2; } h3, h4, h5{ line-height: 1.4; } h5, h6{font-weight: bold;} ol, ul, dd, dt{ font-size: 1rem; line-height: 1.65;} dt{font-weight: bold; margin-top: 0.5rem;} dd{margin-inline-start: 1.5rem;} ul, ol{padding-inline-start: 1.5rem;} img, figure{max-width: 100%; height: auto; } img[data-emoji]{display: inline;} figure img{border-radius: .5rem; display: block;} figcaption{font-size: 0.8rem; text-align: center; color: #666; margin-top: 0.5rem;} @media (prefers-color-scheme: dark) { } a{ transition: opacity 0.2s;} a:hover{opacity: 0.8;} </style></meta></meta></meta></meta><style>@media(prefers-color-scheme:dark){.dark\\:border-gray-700{border-color:undefined!important}@media(prefers-color-scheme:dark){.dark\\:border-gray-700{border-color:rgb(30,32,38)!important}}.dark\\:bg-blue-600{background-color:undefined!important}@media(prefers-color-scheme:dark){.dark\\:bg-blue-600{background-color:rgb(37,99,235)!important}}@media(prefers-color-scheme:dark){.dark\\:bg-blue-600{background-color:rgb(37,99,235)!important}}.dark\\:bg-gray-900{background-color:undefined!important}@media(prefers-color-scheme:dark){.dark\\:bg-gray-900{background-color:rgb(14,15,17)!important}}@media(prefers-color-scheme:dark){.dark\\:bg-gray-900{background-color:rgb(14,15,17)!important}}.dark\\:text-gray-300{color:undefined!important}@media(prefers-color-scheme:dark){.dark\\:text-gray-300{color:rgb(179,185,197)!important}}@media(prefers-color-scheme:dark){.dark\\:text-gray-300{color:rgb(179,185,197)!important}}@media(prefers-color-scheme:dark){.dark\\:text-gray-300{color:rgb(179,185,197)!important}}@media(prefers-color-scheme:dark){.dark\\:text-gray-300{color:rgb(179,185,197)!important}}.dark\\:text-gray-500{color:undefined!important}@media(prefers-color-scheme:dark){.dark\\:text-gray-500{color:rgb(100,110,130)!important}}@media(prefers-color-scheme:dark){.dark\\:text-gray-500{color:rgb(100,110,130)!important}}@media(prefers-color-scheme:dark){.dark\\:text-gray-500{color:rgb(100,110,130)!important}}@media(prefers-color-scheme:dark){.dark\\:text-gray-500{color:rgb(100,110,130)!important}}.dark\\:text-gray-600{color:undefined!important}@media(prefers-color-scheme:dark){.dark\\:text-gray-600{color:rgb(57,65,81)!important}}@media(prefers-color-scheme:dark){.dark\\:text-gray-600{color:rgb(57,65,81)!important}}@media(prefers-color-scheme:dark){.dark\\:text-gray-600{color:rgb(57,65,81)!important}}@media(prefers-color-scheme:dark){.dark\\:text-gray-600{color:rgb(57,65,81)!important}}.dark\\:text-white{color:undefined!important}@media(prefers-color-scheme:dark){.dark\\:text-white{color:rgb(255,255,255)!important}}@media(prefers-color-scheme:dark){.dark\\:text-white{color:rgb(255,255,255)!important}}@media(prefers-color-scheme:dark){.dark\\:text-white{color:rgb(255,255,255)!important}}@media(prefers-color-scheme:dark){.dark\\:text-white{color:rgb(255,255,255)!important}}}</style></head><div id="__vue-email-preview" style="display: none; overflow: hidden; line-height: 1px; opacity: 0; max-height: 0; max-width: 0">Welcome to Space 🚀 This is a test email to test formatting of various elements.🧪<div> ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏ ‌​‍‎‏</div></div><body data-id="__vue-email-body" style="font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;; background-color: rgb(255,255,255); color: rgb(14,15,17);" class="dark:bg-gray-900 dark:text-white"><table align="center" width="100%" data-id="__vue-email-container" role="presentation" cellspacing="0" cellpadding="0" border="0" style="max-width:37.5em; padding-top: 2rem;
padding-bottom: 2rem; padding-left: 1rem;
padding-right: 1rem; max-width: 600px;" class="py-8 px-4 max-w-[600px]"><tbody><tr style="width: 100%"><td><table align="center" width="100%" data-id="__vue-email-section" border="0" cellpadding="0" cellspacing="0" role="presentation" class="mb-6" style="margin-bottom: 1.5rem;"><tbody><tr><td><td data-id="__vue-email-column" role="presentation" class="w-[22px]" style="width: 22px;"><a data-id="__vue-email-link" style="color: #067df7; text-decoration: none" href="https://www.fiction.com" target="_blank"><img data-id="__vue-email-img" style="display:block;outline:none;border:none;text-decoration:none; border-radius: 0.375rem; border-width: 2px !important; border-color: rgb(255,255,255,0.1) !important; border-style: solid !important;" src="https://fiction-media-dev.s3.amazonaws.com/fiction-relative-media/med669e7e320a32db53a9d762bb-fiction-icon.png?blurhash=U9EMLDD%2500%3Fb9FWBay%25M00Rj%7Eqxu_3%25Mt74n" class="rounded-md !border-2 !border-white/10 !border-solid" width="22"/></a></td><td data-id="__vue-email-column" role="presentation" class="pl-3" style="padding-left: 0.75rem;"><a data-id="__vue-email-link" style="color:#067df7;text-decoration:none; color: rgb(100,110,130); font-weight: 400; font-size: 14px;" href="https://www.fiction.com" target="_blank" class="dark:text-gray-300">Fiction</a></td></td></tr></tbody></table><table align="center" width="100%" data-id="__vue-email-section" border="0" cellpadding="0" cellspacing="0" role="presentation" style="font:&#39;Geist&#39;, -apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;"><tbody><tr><td><p data-id="__vue-email-text" style="font-size:14px;line-height:24px;margin:16px 0;font-weight:bold;font-size:24px;line-height:1.33; margin-top: 0px;
padding-right: 1rem; max-width: 600px;" class="py-8 px-4 max-w-[600px]"><tbody><tr style="width: 100%"><td><table align="center" width="100%" data-id="__vue-email-section" border="0" cellpadding="0" cellspacing="0" role="presentation" class="mb-6" style="margin-bottom: 1.5rem;"><tbody><tr><td><td data-id="__vue-email-column" role="presentation" class="w-[22px]" style="width: 22px;"><a data-id="__vue-email-link" style="color: #067df7; text-decoration: none" href="https://www.fiction.com" target="_blank"><img data-id="__vue-email-img" style="display:block;outline:none;border:none;text-decoration:none; border-radius: 0.375rem; border-width: 2px !important; border-color: rgb(255,255,255,0.1) !important; border-style: solid !important;" src="https://media.fiction.com/fiction-relative-media/med66beae80adce02e14b826291-fiction-icon.png?blurhash=U9EMLDD%2500%3Fb9FWBay%25M00Rj%7Eqxu_3%25Mt74n" class="rounded-md !border-2 !border-white/10 !border-solid" width="22"/></a></td><td data-id="__vue-email-column" role="presentation" class="pl-3" style="padding-left: 0.75rem;"><a data-id="__vue-email-link" style="color:#067df7;text-decoration:none; color: rgb(100,110,130); font-weight: 400; font-size: 14px;" href="https://www.fiction.com" target="_blank" class="dark:text-gray-300">Fiction</a></td></td></tr></tbody></table><table align="center" width="100%" data-id="__vue-email-section" border="0" cellpadding="0" cellspacing="0" role="presentation" style="font:&#39;Geist&#39;, -apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;"><tbody><tr><td><p data-id="__vue-email-text" style="font-size:14px;line-height:24px;margin:16px 0;font-weight:bold;font-size:24px;line-height:1.33; margin-top: 0px;
margin-bottom: 0px;" class="my-0">Welcome to Space 🚀</p><p data-id="__vue-email-text" style="font-size:14px;line-height:24px;margin:16px 0;font-weight:normal;font-size:24px;line-height:1.33; margin-top: 0px;
margin-bottom: 0px; color: rgb(100,110,130);" class="my-0 text-gray-500"><span>This is a test email to test formatting of various elements.🧪</span> ↘ </p></td></tr></tbody></table><hr data-id="__vue-email-hr" style="width:100%;border:none;border-top:1px solid #eaeaea; margin-top: 2rem;
margin-bottom: 2rem; border-color: rgb(222,223,226);" class="dark:border-gray-700"><div data-id="__vue-email-markdown" class="body-content"><h1 data-id="vue-email-heading" style="font-weight:500;padding-top:20;font-size:2.5rem">Welcome to the <a href="#" style="color:#2C67FF" data-id="vue-email-link" target="_blank">Galactic Gazette</a>! Your Ultimate Source for Space Adventures!</h1>
Expand Down Expand Up @@ -201,7 +201,7 @@ describe('transactional email', async () => {
padding-bottom: 0.75rem; padding-left: 1rem;
padding-right: 1rem; border-radius: 0.375rem; font-size: 16px; font-weight: 700; user-select: none;" href="#" target="_blank" class="dark:bg-blue-600 hover:opacity-80">Confirm email address &#x2192;</a></td></td></tr></tbody></table></td></tr></tbody></table><hr data-id="__vue-email-hr" style="width:100%;border:none;border-top:1px solid #eaeaea; margin-top: 3rem;
margin-bottom: 3rem; border-color: rgb(100,110,130); opacity: 0.3;" class="my-12 border-gray-500 opacity-30"><table align="center" width="100%" data-id="__vue-email-section" border="0" cellpadding="0" cellspacing="0" role="presentation" class="dark:text-gray-500 text-normal" style="margin-top: 2rem; text-align: left; color: rgb(179,185,197); font-size: 0.75rem;
line-height: 1rem;"><tbody><tr><td><td data-id="__vue-email-column" role="presentation" class="w-[65%] align-top" style="width: 65%; vertical-align: top;"><img data-id="__vue-email-img" style="display:block;outline:none;border:none;text-decoration:none;" src="https://fiction-media-dev.s3.amazonaws.com/fiction-relative-media/med669e7e32b2e1438f0ad20b93-fiction-email-footer.png?blurhash=U2DS%5D%5D%7Eq00_N00_4%25M4n00_N%3FcIU%7Eq9F%25M-%3B" width="80" alt="Personal Marketing Tools by Fiction"><p data-id="__vue-email-text" style="font-size: 14px; line-height: 24px; margin: 16px 0;"><a data-id="__vue-email-link" style="color:#067df7;text-decoration:none; color: rgb(179,185,197); margin-top: 1rem;" href="https://www.fiction.com" target="_blank" class="text-normal dark:text-gray-600">Personal Marketing Tools by Fiction ↗ </a></p></img></td><td data-id="__vue-email-column" role="presentation" class="w-[35%] text-right align-top text-xs" style="width: 35%; text-align: right; vertical-align: top; font-size: 0.75rem;
line-height: 1rem;"><tbody><tr><td><td data-id="__vue-email-column" role="presentation" class="w-[65%] align-top" style="width: 65%; vertical-align: top;"><img data-id="__vue-email-img" style="display:block;outline:none;border:none;text-decoration:none;" src="https://media.fiction.com/fiction-relative-media/med66beae8314ad25c355f2f87d-fiction-email-footer.png?blurhash=U2DS%5D%5D%7Eq00_N00_4%25M4n00_N%3FcIU%7Eq9F%25M-%3B" width="80" alt="Personal Marketing Tools by Fiction"><p data-id="__vue-email-text" style="font-size: 14px; line-height: 24px; margin: 16px 0;"><a data-id="__vue-email-link" style="color:#067df7;text-decoration:none; color: rgb(179,185,197); margin-top: 1rem;" href="https://www.fiction.com" target="_blank" class="text-normal dark:text-gray-600">Personal Marketing Tools by Fiction ↗ </a></p></img></td><td data-id="__vue-email-column" role="presentation" class="w-[35%] text-right align-top text-xs" style="width: 35%; text-align: right; vertical-align: top; font-size: 0.75rem;
line-height: 1rem;"><!--v-if--><a data-id="__vue-email-link" style="color:#067df7;text-decoration:none; color: rgb(179,185,197);" href="https://www.fiction.com/unsubscribe" target="_blank" class="dark:text-gray-600 text-normal"> Unsubscribe </a></td></td></tr></tbody></table></hr></hr></td></tr></tbody></table></body></html>"
`)

Expand Down

0 comments on commit 4cdeceb

Please sign in to comment.