Skip to content

Commit

Permalink
Test update for #59
Browse files Browse the repository at this point in the history
  • Loading branch information
gregv committed Dec 2, 2023
1 parent 97ad4f2 commit 1769867
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/e2e/onboarding.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
setSignupPassword,
} from '../playwright-utils.ts'
import { readEmail } from '../mocks/utils.ts'
import { siteEmailAddress } from '~/data.ts'
import { siteEmailAddressWithName } from '~/data.ts'

const urlRegex = /(?<url>https?:\/\/[^\s$.?#].[^\s]*)/
function extractUrl(text: string) {
Expand Down Expand Up @@ -63,7 +63,7 @@ test('onboarding with link', async ({ page }) => {
const email = await readEmail(onboardingData.email)
invariant(email, 'Email not found')
expect(email.to).toBe(onboardingData.email)
expect(email.from).toBe(siteEmailAddress)
expect(email.from).toBe(siteEmailAddressWithName)
expect(email.subject).toMatch(/welcome/i)
const onboardingUrl = extractUrl(email.text)
invariant(onboardingUrl, 'Onboarding URL not found')
Expand Down Expand Up @@ -139,7 +139,7 @@ test('onboarding with a short code', async ({ page }) => {
const email = await readEmail(onboardingData.email)
invariant(email, 'Email not found')
expect(email.to).toBe(onboardingData.email)
expect(email.from).toBe(siteEmailAddress)
expect(email.from).toBe(siteEmailAddressWithName)
expect(email.subject).toMatch(/welcome/i)
const codeMatch = email.text.match(
/Here's your verification code: (?<code>\d+)/,
Expand Down Expand Up @@ -188,7 +188,7 @@ test('reset password with a link', async ({ page }) => {
invariant(email, 'Email not found')
expect(email.subject).toMatch(/password reset/i)
expect(email.to).toBe(user.email)
expect(email.from).toBe(siteEmailAddress)
expect(email.from).toBe(siteEmailAddressWithName)
const resetPasswordUrl = extractUrl(email.text)
invariant(resetPasswordUrl, 'Reset password URL not found')
await page.goto(resetPasswordUrl)
Expand Down Expand Up @@ -239,7 +239,7 @@ test('reset password with a short code', async ({ page }) => {
invariant(email, 'Email not found')
expect(email.subject).toMatch(/password reset/i)
expect(email.to).toBe(user.email)
expect(email.from).toBe(siteEmailAddress)
expect(email.from).toBe(siteEmailAddressWithName)
const codeMatch = email.text.match(
/Here's your verification code: (?<code>\d+)/,
)
Expand Down

0 comments on commit 1769867

Please sign in to comment.